Skip to content

Commit

Permalink
catch errors in mocha output format (same as jest)
Browse files Browse the repository at this point in the history
  • Loading branch information
emarteca committed Aug 25, 2023
1 parent a875faa commit 7dc635f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/output_parsing/test_output_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ def parse_mocha_json_to_csv(output_file, new_output_file=None):
test_stdout += [""]
test_pass_fail += ["passed"]
res_df = pd.DataFrame(list(zip(test_suites, test_names, test_runtimes, test_stdout, test_pass_fail)))
res_df.columns = ["test_suite", "name", "runtime", "stdout", "pass_fail"]
with open(new_output_file, 'w') as csv_file:
csv_file.write(res_df.to_csv())
try:
res_df.columns = ["test_suite", "name", "runtime", "stdout", "pass_fail"]
with open(new_output_file, 'w') as csv_file:
csv_file.write(res_df.to_csv())
except:
print("ERROR in data for file " + new_output_file + " -- no output printed. skipping to next step...")

# parse the output of jest xunit reporter to a csv
# this does the same thing as for mocha, to produce the same data fields
Expand Down

0 comments on commit 7dc635f

Please sign in to comment.