Files
bind9/util/generate-tsan-stress-jobs.py
Michal Nowak 6e2272d769 No need to delete the "only" keyword in generate-tsan-stress-jobs.py
29fd756408 replaced "only" with "rules" in
.gitlab-ci.yml but forgot to drop the removal from here, hence the
script was broken.
2025-02-28 09:01:46 +01:00

39 lines
1.3 KiB
Python
Executable File

#!/usr/bin/env python3
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import yaml
NUMBER_OF_TESTS_PER_TSAN_JOB = 50
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":
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}
]
print(
yaml.dump(
{f"{test_type}:{tsan_job}:stress": tsan_stress_test_job},
Dumper=yaml.Dumper,
)
)