File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 22import os
33import sys
44from pathlib import Path
5+ from pprint import pformat
56
67working_dir = Path (os .environ ["PDM_RUN_CWD" ] if "PDM_RUN_CWD" in os .environ else "./" )
78
1112gold_path = gold_path if gold_path .is_absolute () else working_dir / gold_path
1213gate_path = gate_path if gate_path .is_absolute () else working_dir / gate_path
1314
15+ def on_ci ():
16+ if "CI" in os .environ and os .environ ["CI" ]:
17+ return True
18+ return False
19+
1420def main ():
1521 with open (gold_path , "r" ) as f :
1622 gold = json .load (f )
1723 with open (gate_path , "r" ) as f :
1824 gate = json .load (f )
1925 if len (gold ["events" ]) != len (gate ["events" ]):
2026 print (f"Failed! Event mismatch: { len (gold ['events' ])} events in reference, { len (gate ['events' ])} in test output" )
27+ if on_ci ():
28+ print (f"Test Output:\n { pformat (gate )} \n " )
29+ print (f"Reference events:\n { pformat (gold )} \n " )
2130 return 1
2231 for ev_gold , ev_gate in zip (gold ["events" ], gate ["events" ]):
2332 if ev_gold ["peripheral" ] != ev_gate ["peripheral" ] or \
You can’t perform that action at this time.
0 commit comments