Skip to content

Commit

Permalink
Trigger OnlineDDL workflow when test data changes (#11827)
Browse files Browse the repository at this point in the history
* trigger OnlineDDL workflow when test data changes

Signed-off-by: Florent Poinsard <[email protected]>

* trigger schemadiff workflows too

Signed-off-by: Florent Poinsard <[email protected]>

Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui authored Nov 28, 2022
1 parent 35216e8 commit 8d35dce
Show file tree
Hide file tree
Showing 26 changed files with 41 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_declarative.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_declarative_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cluster_endtoend_onlineddl_ghost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_ghost.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_ghost_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cluster_endtoend_onlineddl_revert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_revert.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_revert_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_revertible.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_revertible_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cluster_endtoend_onlineddl_scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_scheduler.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cluster_endtoend_onlineddl_singleton.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_singleton.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_singleton_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cluster_endtoend_onlineddl_vrepl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_vrepl.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cluster_endtoend_schemadiff_vrepl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_schemadiff_vrepl.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql57.yml'
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ jobs:
- 'test.go'
- 'Makefile'
- 'build.env'
- 'go.[sumod]'
- 'go.sum'
- 'go.mod'
- 'proto/*.proto'
- 'tools/**'
- 'config/**'
Expand All @@ -70,7 +71,9 @@ jobs:
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range
# Limit local port range to not use ports that overlap with server side
# ports that we listen on.
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
# Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
Expand Down
12 changes: 8 additions & 4 deletions test/ci_workflow_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,12 @@ func setupTestDockerFile(test *selfHostedTest) error {
return nil
}

func writeFileFromTemplate(templateFile, path string, test any) error {
tpl, err := template.ParseFiles(templateFile)
func writeFileFromTemplate(templateFile, filePath string, test any) error {
tpl := template.New(path.Base(templateFile))
tpl.Funcs(template.FuncMap{
"contains": strings.Contains,
})
tpl, err := tpl.ParseFiles(templateFile)
if err != nil {
return fmt.Errorf("Error: %s\n", err)
}
Expand All @@ -422,7 +426,7 @@ func writeFileFromTemplate(templateFile, path string, test any) error {
return fmt.Errorf("Error: %s\n", err)
}

f, err := os.Create(path)
f, err := os.Create(filePath)
if err != nil {
return fmt.Errorf("Error creating file: %s\n", err)
}
Expand All @@ -432,6 +436,6 @@ func writeFileFromTemplate(templateFile, path string, test any) error {
if _, err := f.WriteString(mergeBlankLines(buf)); err != nil {
return err
}
fmt.Printf("Generated %s\n", path)
fmt.Printf("Generated %s\n", filePath)
return nil
}
3 changes: 3 additions & 0 deletions test/templates/cluster_endtoend_test.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/{{.FileName}}'
{{- if or (contains .Name "onlineddl") (contains .Name "schemadiff") }}
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
{{- end}}

- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
3 changes: 3 additions & 0 deletions test/templates/cluster_endtoend_test_mysql57.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/{{.FileName}}'
{{- if or (contains .Name "onlineddl") (contains .Name "schemadiff") }}
- 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
{{- end}}

- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down

0 comments on commit 8d35dce

Please sign in to comment.