Skip to content

Commit

Permalink
Enhance log from test_flag_system_as_converted.py test failures.
Browse files Browse the repository at this point in the history
When the log files on the converted system fail to validate, print the
log files in full so that we know what the data was.
  • Loading branch information
abadger committed Oct 21, 2022
1 parent e5da3c0 commit 0833fa8
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@ def test_flag_system_as_converted(shell):
with open(C2R_MIGRATION_RESULTS, "r") as data:
data_json = json.load(data)
# If some difference between generated json and its schema invoke exception
jsonschema.validate(instance=data_json, schema=C2R_MIGRATION_RESULTS_SCHEMA)
try:
jsonschema.validate(instance=data_json, schema=C2R_MIGRATION_RESULTS_SCHEMA)
except Exception:
print(data_json)
raise

if submgr_disabled_var not in query:
assert os.path.exists(C2R_RHSM_CUSTOM_FACTS)

with open(C2R_RHSM_CUSTOM_FACTS, "r") as data:
data_json = json.load(data)
# If some difference between generated json and its schema invoke exception
jsonschema.validate(instance=data_json, schema=C2R_RHSM_CUSTOM_FACTS_SCHEMA)
try:
jsonschema.validate(instance=data_json, schema=C2R_RHSM_CUSTOM_FACTS_SCHEMA)
except Exception:
print(data_json)
raise

0 comments on commit 0833fa8

Please sign in to comment.