2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

chg: ci: Generate TSAN stress test

Merge branch 'mnowak/generate-tsan-stress-jobs' into 'main'

See merge request isc-projects/bind9!9334
This commit is contained in:
Michal Nowak
2024-08-28 09:39:32 +00:00
2 changed files with 65 additions and 0 deletions

View File

@@ -1312,6 +1312,35 @@ unit:clang:tsan:
- job: clang:tsan - job: clang:tsan
artifacts: true artifacts: true
generate-tsan-stress-test-configs:
<<: *base_image
<<: *default_triggering_rules
stage: system
script:
- util/generate-tsan-stress-jobs.py > tsan-stress-test-configs.yml
artifacts:
paths:
- tsan-stress-test-configs.yml
needs: []
when: manual
tsan:stress:
<<: *default_triggering_rules
stage: postcheck
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
trigger:
include:
- artifact: tsan-stress-test-configs.yml
job: generate-tsan-stress-test-configs
needs:
- job: generate-tsan-stress-test-configs
artifacts: true
- job: gcc:tsan
artifacts: true
- job: clang:tsan
artifacts: true
# Jobs for Clang builds on Debian 12 "bookworm" (amd64) # Jobs for Clang builds on Debian 12 "bookworm" (amd64)
clang:bookworm:amd64: clang:bookworm:amd64:

View File

@@ -0,0 +1,36 @@
#!/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":
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"]
print(
yaml.dump(
{f"system:{tsan_job}:stress": tsan_stress_test_job},
Dumper=yaml.Dumper,
)
)