Skip to content

Commit

Permalink
Update output checking script
Browse files Browse the repository at this point in the history
  • Loading branch information
dfornika committed Jun 11, 2024
1 parent a06ca11 commit 9e35ea3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
12 changes: 9 additions & 3 deletions .github/scripts/check_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import hashlib
import json
import os
import sys

from pathlib import Path

Expand Down Expand Up @@ -291,17 +292,22 @@ def main(args):

output_path = os.path.join(args.outdir, "check_outputs_summary.csv")
with open(output_path, 'w') as f:
writer = csv.DictWriter(f, fieldnames=output_fields, extrasaction='ignore')
writer.writeheader()
file_writer = csv.DictWriter(f, fieldnames=output_fields, extrasaction='ignore')
stdout_writer = csv.DictWriter(sys.stdout, fieldnames=output_fields, extrasaction='ignore', delimiter='\t')
stdout_writer.writeheader()
file_writer.writeheader()
for test in tests:
test["test_result"] = "FAIL"
if test["test_passed"]:
test["test_result"] = "PASS"

writer.writerow(test)
stdout_writer.writerow(test)
file_writer.writerow(test)

for test in tests:
if not test['test_passed']:
print(f"\nTest: {test['test_name']} failed.")
print(f"See {output_path} for more details.")
exit(1)


Expand Down
11 changes: 1 addition & 10 deletions .github/scripts/check_outputs.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#!/usr/bin/env bash
#!/bin/bash

.github/scripts/check_outputs.py \
--analysis-outdir-upstream .github/data/test_output/KevinKuchinski-FluViewer-output \
--analysis-outdir-origin .github/data/test_output/BCCDC-PHL-FluViewer-output \
--outdir artifacts

column -ts ',' artifacts/check_outputs_summary.csv

while read -r test_name test_result; do
if [ "$test_result" == "FAIL" ]; then
echo "Test $test_name failed"
exit 1
fi
done < tail -n+2 artifacts/check_outputs_summary.csv

0 comments on commit 9e35ea3

Please sign in to comment.