File tree 3 files changed +20
-10
lines changed
3 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -60,13 +60,23 @@ jobs:
60
60
shell : bash -x -e {0}
61
61
run : |
62
62
METRICS_SUMMARY_FILE="metrics_summary.json"
63
- echo -e "\n\n## ${{ inputs.FW_NAME }} MGMN Test Metrics" >> $METRICS_SUMMARY_FILE
64
- for i in metrics-test-log/*_metrics.json; do
65
- echo $i | cut -d'.' -f1
66
- echo '```json'
67
- jq . $i
68
- echo '```'
69
- done | tee -a $METRICS_SUMMARY_FILE
63
+
64
+ echo '## Upstream ${{ inputs.FW_NAME }} MGMN Test Metrics' | tee -a $METRICS_SUMMARY_FILE
65
+ python <<EOF | tee -a $METRICS_SUMMARY_FILE
66
+ import json
67
+ files = "$(echo upstream-${{ inputs.FW_NAME }}-metrics-test-log/*_metrics.json)".split()
68
+ header = None
69
+ print_row = lambda lst: print('| ' + ' | '.join(str(el) for el in lst) + ' |')
70
+ for path in files:
71
+ with open(path) as f:
72
+ obj = json.loads(f.read())
73
+ if not header:
74
+ header = list(obj.keys())
75
+ print_row(["Job Name"] + header)
76
+ print_row(["---"] * (1+len(header)))
77
+ job_name = path[:-len('_metrics.json')]
78
+ print_row([job_name] + [obj[h] for h in header])
79
+ EOF
70
80
71
81
cat $METRICS_SUMMARY_FILE >> $GITHUB_STEP_SUMMARY
72
82
echo "METRICS_SUMMARY_FILE=$METRICS_SUMMARY_FILE" >> ${GITHUB_OUTPUT}
83
93
failed_tests=$(jq -r '. | select ((.state != "COMPLETED") or (.exitcode != "0")) | .state' $EXIT_STATUSES | wc -l)
84
94
total_tests=$(ls $EXIT_STATUSES | wc -l)
85
95
86
- METRICS_LOG=metrics-test-log/report.jsonl
96
+ METRICS_LOG=upstream-${{ inputs.FW_NAME }}- metrics-test-log/report.jsonl
87
97
all_outcomes() {
88
98
cat $METRICS_LOG | jq -r '. | select((.["$report_type"] == "TestReport") and (.when == "call")) | .outcome'
89
99
}
Original file line number Diff line number Diff line change @@ -474,7 +474,7 @@ jobs:
474
474
- name : Upload metrics test json logs
475
475
uses : actions/upload-artifact@v3
476
476
with :
477
- name : metrics-test-log
477
+ name : upstream-${{ inputs.FW_NAME }}- metrics-test-log
478
478
path : |
479
479
report.jsonl
480
480
*_metrics.json
Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ jobs:
320
320
- name : Upload metrics test json logs
321
321
uses : actions/upload-artifact@v3
322
322
with :
323
- name : metrics-test-log
323
+ name : upstream-${{ inputs.FW_NAME }}- metrics-test-log
324
324
path : |
325
325
report.jsonl
326
326
*_metrics.json
You can’t perform that action at this time.
0 commit comments