ClickHouse/tests/ci/test_ci_config.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
1.0 KiB
Python
Raw Normal View History

#!/usr/bin/env python3
import unittest
from ci_config import CIStages, JobNames, CI_CONFIG, Runners
2024-01-19 16:02:17 +00:00
class TestCIConfig(unittest.TestCase):
def test_runner_config(self):
"""check runner is provided w/o exception"""
for job in JobNames:
runner = CI_CONFIG.get_runner_type(job)
self.assertIn(runner, Runners)
def test_job_stage_config(self):
"""check runner is provided w/o exception"""
for job in JobNames:
stage = CI_CONFIG.get_job_ci_stage(job)
if job in [
JobNames.STYLE_CHECK,
JobNames.FAST_TEST,
JobNames.JEPSEN_KEEPER,
JobNames.BUILD_CHECK,
JobNames.BUILD_CHECK_SPECIAL,
]:
assert (
stage == CIStages.NA
), "These jobs are not in CI stages, must be NA"
else:
assert stage != CIStages.NA, f"stage not found for [{job}]"
self.assertIn(stage, CIStages)