Add test for master scheduler with when

This commit is contained in:
jeanluc 2022-10-11 09:25:39 +02:00 committed by Megan Wilhite
parent 6805a24d55
commit 553ff63a38

View file

@ -68,7 +68,8 @@ def _check_last_run(schedule, job_name, runtime=None):
@pytest.mark.slow_test
def test_eval(schedule):
@pytest.mark.parametrize("master", [False, True])
def test_eval(schedule, master):
"""
verify that scheduled job runs
"""
@ -83,6 +84,10 @@ def test_eval(schedule):
# Add the job to the scheduler
schedule.opts.update(job)
# The master does not have grains
if master:
schedule.opts.pop("grains", None)
# Evaluate 1 second before the run time
schedule.eval(now=run_time1)
ret = schedule.job_status(job_name)