Merge pull request #63238 from ClickHouse/azure_run_with_msan

Add run with msan
This commit is contained in:
alesapin 2024-05-01 16:39:39 +00:00 committed by GitHub
commit c0a6acc06a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 62 additions and 10 deletions

View File

@ -849,7 +849,6 @@ class CiOptions:
jobs_to_do: List[str],
jobs_to_skip: List[str],
jobs_params: Dict[str, Dict[str, Any]],
run_only_if_included: bool,
) -> Tuple[List[str], List[str], Dict[str, Dict[str, Any]]]:
"""
Applies specified options on CI Run Config
@ -932,10 +931,6 @@ class CiOptions:
)
jobs_to_do_requested = list(label_config.run_jobs)
if run_only_if_included and not jobs_to_do_requested:
jobs_to_skip += jobs_to_do
jobs_to_do = []
if jobs_to_do_requested:
jobs_to_do_requested = list(set(jobs_to_do_requested))
print(
@ -948,10 +943,12 @@ class CiOptions:
# we need to add params - otherwise it won't run as "batches" list will be empty
for job in jobs_to_do:
if job not in jobs_params:
num_batches = CI_CONFIG.get_job_config(job).num_batches
job_config = CI_CONFIG.get_job_config(job)
num_batches = job_config.num_batches
jobs_params[job] = {
"batches": list(range(num_batches)),
"num_batches": num_batches,
"run_if_ci_option_include_set": job_config.run_by_ci_option,
}
# 4. Handle "batch_" tags
@ -963,6 +960,18 @@ class CiOptions:
if params["num_batches"] > 1:
params["batches"] = self.job_batches
for job in jobs_to_do[:]:
job_param = jobs_params[job]
if (
job_param["run_if_ci_option_include_set"]
and job not in jobs_to_do_requested
):
print(
f"Erasing job '{job}' from list because it's not in included set, but will run only by include"
)
jobs_to_skip.append(job)
jobs_to_do.remove(job)
return jobs_to_do, jobs_to_skip, jobs_params
@ -1455,7 +1464,7 @@ def _configure_jobs(
]
jobs_to_do, jobs_to_skip, jobs_params = ci_options.apply(
jobs_to_do, jobs_to_skip, jobs_params, job_config.run_by_ci_option
jobs_to_do, jobs_to_skip, jobs_params
)
return {

View File

@ -131,6 +131,7 @@ class JobNames(metaclass=WithIter):
STRESS_TEST_MSAN = "Stress test (msan)"
STRESS_TEST_DEBUG = "Stress test (debug)"
STRESS_TEST_AZURE_TSAN = "Stress test (azure, tsan)"
STRESS_TEST_AZURE_MSAN = "Stress test (azure, msan)"
INTEGRATION_TEST = "Integration tests (release)"
INTEGRATION_TEST_ASAN = "Integration tests (asan)"
@ -1234,6 +1235,9 @@ CI_CONFIG = CIConfig(
JobNames.STRESS_TEST_AZURE_TSAN: TestConfig(
Build.PACKAGE_TSAN, job_config=JobConfig(**stress_test_common_params, release_only=True, run_by_ci_option=True) # type: ignore
),
JobNames.STRESS_TEST_AZURE_MSAN: TestConfig(
Build.PACKAGE_MSAN, job_config=JobConfig(**stress_test_common_params, release_only=True, run_by_ci_option=True) # type: ignore
),
JobNames.UPGRADE_TEST_TSAN: TestConfig(
Build.PACKAGE_TSAN, job_config=JobConfig(pr_only=True, random_bucket="upgrade_with_sanitizer", **upgrade_test_common_params) # type: ignore
),

View File

@ -44,6 +44,10 @@ _TEST_BODY_3 = """
- [x] <!---ci_include_analyzer--> Must include all tests for analyzer
"""
_TEST_BODY_4 = """
"""
_TEST_JOB_LIST = [
"Style check",
"Fast test",
@ -152,9 +156,15 @@ class TestCIOptions(unittest.TestCase):
)
jobs_to_do = list(_TEST_JOB_LIST)
jobs_to_skip = []
job_params = {}
job_params = {
"Stateless tests (azure, asan)": {
"batches": list(range(3)),
"num_batches": 3,
"run_if_ci_option_include_set": True,
}
}
jobs_to_do, jobs_to_skip, job_params = ci_options.apply(
jobs_to_do, jobs_to_skip, job_params, False
jobs_to_do, jobs_to_skip, job_params
)
self.assertCountEqual(
jobs_to_do,
@ -186,7 +196,7 @@ class TestCIOptions(unittest.TestCase):
jobs_to_skip = []
job_params = {}
jobs_to_do, jobs_to_skip, job_params = ci_options.apply(
jobs_to_do, jobs_to_skip, job_params, False
jobs_to_do, jobs_to_skip, job_params
)
self.assertCountEqual(
jobs_to_do,
@ -198,3 +208,32 @@ class TestCIOptions(unittest.TestCase):
"package_asan",
],
)
def test_options_applied_3(self):
self.maxDiff = None
ci_options = CiOptions.create_from_pr_message(
_TEST_BODY_4, update_from_api=False
)
self.assertIsNone(ci_options.include_keywords, None)
self.assertIsNone(ci_options.exclude_keywords, None)
jobs_to_do = list(_TEST_JOB_LIST)
jobs_to_skip = []
job_params = {}
for job in _TEST_JOB_LIST:
if "Stateless" in job:
job_params[job] = {
"batches": list(range(3)),
"num_batches": 3,
"run_if_ci_option_include_set": "azure" in job,
}
else:
job_params[job] = {"run_if_ci_option_include_set": False}
jobs_to_do, jobs_to_skip, job_params = ci_options.apply(
jobs_to_do, jobs_to_skip, job_params
)
self.assertNotIn(
"Stateless tests (azure, asan)",
jobs_to_do,
)