MCPcopy Index your code
hub / github.com/bytebase/bytebase / equalReviewResultProtos

Function equalReviewResultProtos

backend/tests/sql_review_test.go:530–542  ·  view source on GitHub ↗
(a *require.Assertions, want, got []*v1pb.PlanCheckRun_Result, expectedTarget, message string)

Source from the content-addressed store, hash-verified

528}
529
530func equalReviewResultProtos(a *require.Assertions, want, got []*v1pb.PlanCheckRun_Result, expectedTarget, message string) {
531 a.Equal(len(want), len(got), message)
532 for i := 0; i < len(want); i++ {
533 // Verify target matches expected database
534 a.Equal(expectedTarget, got[i].Target, message)
535 // Verify type is STATEMENT_ADVISE (we filter for this type)
536 a.Equal(v1pb.PlanCheckRun_Result_STATEMENT_ADVISE, got[i].Type, message)
537 // Compare other fields, ignoring target and type since we checked them above
538 diff := cmp.Diff(want[i], got[i], protocmp.Transform(),
539 protocmp.IgnoreFields(&v1pb.PlanCheckRun_Result{}, "target", "type"))
540 a.Empty(diff, message)
541 }
542}
543
544func prodTemplateReviewConfigForPostgreSQL() *v1pb.ReviewConfig {
545 config := &v1pb.ReviewConfig{

Callers 2

TestSQLReviewForMySQLFunction · 0.85

Calls 1

EqualMethod · 0.65

Tested by

no test coverage detected