From b4aab2cfa3b7458f858b11b9a81c25bb44af90f6 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Wed, 4 Sep 2024 20:10:27 +0200 Subject: [PATCH] Generate TSAN unit stress tests (cherry picked from commit a03c4b4cf993a3aaafbe2c7aac919e07d8d60131) --- util/generate-tsan-stress-jobs.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/util/generate-tsan-stress-jobs.py b/util/generate-tsan-stress-jobs.py index f0c57f8bba..a8b6566bd8 100755 --- a/util/generate-tsan-stress-jobs.py +++ b/util/generate-tsan-stress-jobs.py @@ -19,18 +19,21 @@ with open(".gitlab-ci.yml", encoding="utf-8") as gitlab_ci_yml: anchors = yaml.load(gitlab_ci_yml, Loader=yaml.Loader) for tsan_job in "gcc:tsan", "clang:tsan": - tsan_stress_test_job = anchors[f"system:{tsan_job}"] - tsan_stress_test_job["stage"] = "test" - tsan_stress_test_job["rules"] = [{"if": '$CI_PIPELINE_SOURCE == "parent_pipeline"'}] - tsan_stress_test_job["parallel"] = NUMBER_OF_TESTS_PER_TSAN_JOB - tsan_stress_test_job["needs"] = [ - {"pipeline": "$PARENT_PIPELINE_ID", "job": tsan_job} - ] - del tsan_stress_test_job["only"] + for test_type in "unit", "system": + tsan_stress_test_job = anchors[f"{test_type}:{tsan_job}"] + tsan_stress_test_job["stage"] = "test" + tsan_stress_test_job["rules"] = [ + {"if": '$CI_PIPELINE_SOURCE == "parent_pipeline"'} + ] + tsan_stress_test_job["parallel"] = NUMBER_OF_TESTS_PER_TSAN_JOB + tsan_stress_test_job["needs"] = [ + {"pipeline": "$PARENT_PIPELINE_ID", "job": tsan_job} + ] + del tsan_stress_test_job["only"] - print( - yaml.dump( - {f"system:{tsan_job}:stress": tsan_stress_test_job}, - Dumper=yaml.Dumper, + print( + yaml.dump( + {f"{test_type}:{tsan_job}:stress": tsan_stress_test_job}, + Dumper=yaml.Dumper, + ) ) - )