Skip to content

Commit

Permalink
feat: add the workflow generation changes to make the debug mode work…
Browse files Browse the repository at this point in the history
… in CI

Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 committed Jul 23, 2024
1 parent b8b2efc commit d50313a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cluster_endtoend_vtgate_transaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_transaction | tee -a output.txt | go-junit-report -set-exit-code > report.xml
eatmydata -- go run test.go -docker=false -follow -shard vtgate_transaction -build-tag=debug2PC | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
Expand Down
4 changes: 4 additions & 0 deletions test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ var (
dryRun = flag.Bool("dry-run", false, "For each test to be run, it will output the test attributes, but NOT run the tests. Useful while debugging changes to test.go (this file)")
remoteStats = flag.String("remote-stats", "", "url to send remote stats")
buildVTAdmin = flag.Bool("build-vtadmin", false, "Enable or disable VTAdmin build during 'make build'")
buildTag = flag.String("build-tag", "", "Build tag to create a custom debug build")
)

var (
Expand Down Expand Up @@ -433,6 +434,9 @@ func main() {
if !*buildVTAdmin {
command.Env = append(os.Environ(), "NOVTADMINBUILD=1")
}
if *buildTag != "" {
command.Env = append(command.Env, fmt.Sprintf(`EXTRA_BUILD_TAGS=%s`, *buildTag))
}
if out, err := command.CombinedOutput(); err != nil {
log.Fatalf("make build failed; exit code: %d, error: %v\n%s",
command.ProcessState.ExitCode(), err, out)
Expand Down
10 changes: 8 additions & 2 deletions test/ci_workflow_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ var (
"vttablet_prscomplex",
}

buildTag = map[string]string{
"vtgate_transaction": "debug2PC",
}

vitessTesterMap = map[string]string{
"vtgate": "./go/test/endtoend/vtgate/vitess_tester",
}
Expand Down Expand Up @@ -158,6 +162,7 @@ type unitTest struct {
type clusterTest struct {
Name, Shard, Platform string
FileName string
BuildTag string
MemoryCheck bool
MakeTools, InstallXtraBackup bool
Docker bool
Expand Down Expand Up @@ -245,8 +250,9 @@ func generateClusterWorkflows(list []string, tpl string) {
for _, cluster := range clusters {
for _, mysqlVersion := range clusterMySQLVersions() {
test := &clusterTest{
Name: fmt.Sprintf("Cluster (%s)", cluster),
Shard: cluster,
Name: fmt.Sprintf("Cluster (%s)", cluster),
Shard: cluster,
BuildTag: buildTag[cluster],
}
cores16Clusters := canonnizeList(clusterRequiring16CoresMachines)
for _, cores16Cluster := range cores16Clusters {
Expand Down
2 changes: 1 addition & 1 deletion test/templates/cluster_endtoend_test.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ jobs:
{{end}}

# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker={{if .Docker}}true -flavor={{.Platform}}{{else}}false{{end}} -follow -shard {{.Shard}}{{if .PartialKeyspace}} -partial-keyspace=true {{end}} | tee -a output.txt | go-junit-report -set-exit-code > report.xml
eatmydata -- go run test.go -docker={{if .Docker}}true -flavor={{.Platform}}{{else}}false{{end}} -follow -shard {{.Shard}}{{if .PartialKeyspace}} -partial-keyspace=true {{end}}{{if .BuildTag}} -build-tag={{.BuildTag}} {{end}} | tee -a output.txt | go-junit-report -set-exit-code > report.xml

- name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
Expand Down

0 comments on commit d50313a

Please sign in to comment.