From: Michael Tremer Date: Mon, 24 Oct 2022 15:55:41 +0000 (+0000) Subject: tests: Test aborting build jobs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceabd003f455612c2a6f48e7ca7195778ce205f3;p=pbs.git tests: Test aborting build jobs Signed-off-by: Michael Tremer --- diff --git a/tests/build.py b/tests/build.py index 48c97c4a..414d238c 100755 --- a/tests/build.py +++ b/tests/build.py @@ -197,6 +197,27 @@ class BuildTestCase(test.TestCase): log=log, ) + async def test_abort(self): + """ + This test tries to abort a job + """ + 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) + + # Abort all jobs + for job in build.jobs: + await job.abort(self.user) + + self.assertTrue(job.is_aborted()) + self.assertIsNotNone(job.aborted_at) + async def test_log(self): """ This test creates a build and tries to access the log