test/fmt_v1: check assembler failures propagate
Check that if an assembler fails the result is propagated to the overall result status, i.e. the main `success` is also `False`.
This commit is contained in:
parent
dfd7ff2500
commit
74e6302860
1 changed files with 32 additions and 0 deletions
|
|
@ -259,6 +259,38 @@ class TestFormatV1(unittest.TestCase):
|
|||
self.assertIn("success", result["build"])
|
||||
self.assertFalse(result["build"]["success"])
|
||||
|
||||
# check we get results for the assembler pipeline
|
||||
description = {
|
||||
"pipeline": {
|
||||
"stages": [
|
||||
{
|
||||
"name": "org.osbuild.noop"
|
||||
},
|
||||
],
|
||||
"assembler": {
|
||||
"name": "org.osbuild.error"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
manifest = fmt.load(description, index)
|
||||
self.assertIsNotNone(manifest)
|
||||
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
res = self.build_manifest(manifest, tmpdir)
|
||||
|
||||
self.assertIsNotNone(res)
|
||||
result = fmt.output(manifest, res)
|
||||
self.assertIsNotNone(result)
|
||||
|
||||
self.assertIn("assembler", result)
|
||||
self.assertIn("success", result["assembler"])
|
||||
self.assertFalse(result["assembler"]["success"])
|
||||
|
||||
# check the overall result is False as well
|
||||
self.assertIn("success", result)
|
||||
self.assertFalse(result["success"], result)
|
||||
|
||||
def test_validation(self):
|
||||
index = osbuild.meta.Index(os.curdir)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue