(filepath string, tests []test)
| 444 | } |
| 445 | |
| 446 | func writeTestData(filepath string, tests []test) error { |
| 447 | type yamlStruct struct { |
| 448 | Statement string |
| 449 | Result []string |
| 450 | Run bool |
| 451 | } |
| 452 | |
| 453 | var yamlTests []yamlStruct |
| 454 | for _, t := range tests { |
| 455 | yamlTest := yamlStruct{ |
| 456 | Statement: t.Statement, |
| 457 | Run: t.Run, |
| 458 | } |
| 459 | for _, r := range t.Result { |
| 460 | yamlTest.Result = append(yamlTest.Result, protojson.Format(r)) |
| 461 | } |
| 462 | yamlTests = append(yamlTests, yamlTest) |
| 463 | } |
| 464 | |
| 465 | return yamltest.WriteFile(filepath, yamlTests) |
| 466 | } |
| 467 | |
| 468 | func createIssueAndReturnSQLReviewResult(ctx context.Context, a *require.Assertions, ctl *controller, project *v1pb.Project, database *v1pb.Database, statement string, wait bool) []*v1pb.PlanCheckRun_Result { |
| 469 | sheet, err := ctl.sheetServiceClient.CreateSheet(ctx, connect.NewRequest(&v1pb.CreateSheetRequest{ |
no test coverage detected