Skip to content

Commit ca5c4c8

Browse files
committed
Re-run heisenbug in DEBUG mode
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 6936fcd commit ca5c4c8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/scancode/test_cli.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,14 @@ def test_scan_does_scan_php_composer():
660660
expected_file = test_env.get_test_loc('composer/composer.expected.json')
661661
result_file = test_env.get_temp_file('results.json')
662662
run_scan_click(['--package', test_file, '--json', result_file])
663-
check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES)
663+
try:
664+
check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES)
665+
except:
666+
# re-run heisenbug
667+
env = dict(os.environ)
668+
env["SCANCODE_DEBUG_API"] = 'yes'
669+
run_scan_click(['--package', test_file, '--json', result_file], env=env)
670+
check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES)
664671

665672

666673
def test_scan_does_scan_rpm():

0 commit comments

Comments
 (0)