From: Michael Tremer Date: Wed, 19 Oct 2022 15:40:50 +0000 (+0000) Subject: tests: build: Create a case where one job fails X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bda1fb4b9166e65b57ca2432beae779bf29f2b0;p=pbs.git tests: build: Create a case where one job fails Signed-off-by: Michael Tremer --- diff --git a/tests/build.py b/tests/build.py index 61e9c543..48c97c4a 100755 --- a/tests/build.py +++ b/tests/build.py @@ -169,6 +169,34 @@ class BuildTestCase(test.TestCase): log=log, ) + async def test_fail(self): + """ + This test creates a build and pretends a job failed + """ + path = self.source_path("tests/data/beep-1.3-2.ip3.src.pfm") + + # Create the build + with self.db.transaction(): + build = await self._create_build(path, owner=self.user) + + # Assign all jobs to the default builder + for job in build.jobs: + job.assign(self.builder) + + # Pick the first job + job = build.jobs[0] + + # Upload the log + log = await self._create_upload( + self.source_path("tests/data/beep-1.3-2.ip3.x86_64.log"), + ) + + # Pretend that the job has failed + await job.finished( + success=False, + log=log, + ) + async def test_log(self): """ This test creates a build and tries to access the log