mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
hack/ci/ci_yaml_test.py: add test for job timeouts
All jobs should have a timeout set as the default from github is not reasonable with 6 hours. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
5ae652ab9e
commit
be85401b8f
1 changed files with 9 additions and 0 deletions
|
|
@ -43,5 +43,14 @@ class TestCase(unittest.TestCase):
|
|||
if 'uses:' in line:
|
||||
self.assertRegex(line, pattern, msg=f"Action must be pinned with a version number comment, file: .github/workflows/{name}:{i}")
|
||||
|
||||
def test_job_timeout(self):
|
||||
"""ensure all the ci jobs have a timeout set"""
|
||||
for job, item in self.CI_YAML['jobs'].items():
|
||||
# Note some jobs just start another workflow via uses, in this case no runs-on is set and no timeout can be set so skip it.
|
||||
if item.get('runs-on') is not None:
|
||||
timeout = item.get('timeout-minutes')
|
||||
self.assertIsNotNone(timeout, msg=f"job '{job}' has no timeout-minutes set")
|
||||
self.assertLessEqual(timeout, 60, msg=f"job '{job}' should never take longer than 1 hour")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue