test(titan-iac): split dashboard trigger checks
This commit is contained in:
parent
82fe618be9
commit
fd7ec39a15
@ -467,40 +467,3 @@ def test_jobs_dashboard_collapses_heavy_drilldowns_for_light_first_paint():
|
|||||||
assert "> bool 0" in branch_panel["targets"][0]["expr"]
|
assert "> bool 0" in branch_panel["targets"][0]["expr"]
|
||||||
assert branch_panel["targets"][0]["expr"].startswith("sort(")
|
assert branch_panel["targets"][0]["expr"].startswith("sort(")
|
||||||
|
|
||||||
|
|
||||||
def test_in_scope_jenkins_jobs_have_twice_daily_refresh_trigger():
|
|
||||||
casc = pathlib.Path("services/jenkins/configmap-jcasc.yaml").read_text()
|
|
||||||
in_scope_jobs = [
|
|
||||||
"ananke",
|
|
||||||
"ariadne",
|
|
||||||
"atlasbot",
|
|
||||||
"bstein-dev-home",
|
|
||||||
"data-prepper",
|
|
||||||
"metis",
|
|
||||||
"pegasus",
|
|
||||||
"soteria",
|
|
||||||
"titan-iac",
|
|
||||||
]
|
|
||||||
|
|
||||||
for job in in_scope_jobs:
|
|
||||||
block = casc.split(f"pipelineJob('{job}')", 1)[1].split("pipelineJob(", 1)[0]
|
|
||||||
assert "cron" in block
|
|
||||||
assert "spec('H H/12 * * *')" in block
|
|
||||||
|
|
||||||
|
|
||||||
def test_lesavka_jenkins_job_has_daily_refresh_trigger():
|
|
||||||
casc = pathlib.Path("services/jenkins/configmap-jcasc.yaml").read_text()
|
|
||||||
lesavka_block = casc.split("pipelineJob('lesavka')", 1)[1].split("pipelineJob(", 1)[0]
|
|
||||||
|
|
||||||
assert "scmpoll_spec('H/5 * * * *')" in lesavka_block
|
|
||||||
assert "cron" in lesavka_block
|
|
||||||
assert "spec('H H * * *')" in lesavka_block
|
|
||||||
|
|
||||||
|
|
||||||
def test_typhon_jenkins_job_has_daily_refresh_trigger():
|
|
||||||
casc = pathlib.Path("services/jenkins/configmap-jcasc.yaml").read_text()
|
|
||||||
typhon_block = casc.split("pipelineJob('typhon')", 1)[1].split("pipelineJob(", 1)[0]
|
|
||||||
|
|
||||||
assert "scmpoll_spec('H/5 * * * *')" in typhon_block
|
|
||||||
assert "cron" in typhon_block
|
|
||||||
assert "spec('H H * * *')" in typhon_block
|
|
||||||
|
|||||||
41
scripts/tests/test_jenkins_job_triggers.py
Normal file
41
scripts/tests/test_jenkins_job_triggers.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import pathlib
|
||||||
|
|
||||||
|
|
||||||
|
def jcasc_job_block(job: str) -> str:
|
||||||
|
casc = pathlib.Path("services/jenkins/configmap-jcasc.yaml").read_text()
|
||||||
|
return casc.split(f"pipelineJob('{job}')", 1)[1].split("pipelineJob(", 1)[0]
|
||||||
|
|
||||||
|
|
||||||
|
def test_in_scope_jenkins_jobs_have_twice_daily_refresh_trigger():
|
||||||
|
in_scope_jobs = [
|
||||||
|
"ananke",
|
||||||
|
"ariadne",
|
||||||
|
"atlasbot",
|
||||||
|
"bstein-dev-home",
|
||||||
|
"data-prepper",
|
||||||
|
"metis",
|
||||||
|
"pegasus",
|
||||||
|
"soteria",
|
||||||
|
"titan-iac",
|
||||||
|
]
|
||||||
|
|
||||||
|
for job in in_scope_jobs:
|
||||||
|
block = jcasc_job_block(job)
|
||||||
|
assert "cron" in block
|
||||||
|
assert "spec('H H/12 * * *')" in block
|
||||||
|
|
||||||
|
|
||||||
|
def test_lesavka_jenkins_job_has_daily_refresh_trigger():
|
||||||
|
lesavka_block = jcasc_job_block("lesavka")
|
||||||
|
|
||||||
|
assert "scmpoll_spec('H/5 * * * *')" in lesavka_block
|
||||||
|
assert "cron" in lesavka_block
|
||||||
|
assert "spec('H H * * *')" in lesavka_block
|
||||||
|
|
||||||
|
|
||||||
|
def test_typhon_jenkins_job_has_daily_refresh_trigger():
|
||||||
|
typhon_block = jcasc_job_block("typhon")
|
||||||
|
|
||||||
|
assert "scmpoll_spec('H/5 * * * *')" in typhon_block
|
||||||
|
assert "cron" in typhon_block
|
||||||
|
assert "spec('H H * * *')" in typhon_block
|
||||||
Loading…
x
Reference in New Issue
Block a user