tests/stages: write out produced metadata
When the expected metadata does not match the produced metadata, write the latter to `/tmp` for closer inspection; additionally this should help update the metadata file in case the changes are expected.
This commit is contained in:
parent
5de2d3f96b
commit
b4f58ccc72
1 changed files with 4 additions and 1 deletions
|
|
@ -133,7 +133,10 @@ class TestStages(test.TestBase):
|
|||
diff = difflib.ndiff(pprint.pformat(have).splitlines(),
|
||||
pprint.pformat(want).splitlines())
|
||||
txt = "\n".join(diff)
|
||||
self.fail(f"metadata for {stageid} differs:\n{txt}")
|
||||
path = f"/tmp/osbuild.metadata.{stageid}.json"
|
||||
with open(path, "w") as f:
|
||||
json.dump(have, f, indent=2)
|
||||
self.fail(f"metadata for {stageid} differs:\n{txt}\n{path}")
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue