fix: HTML Test Report Improvements#912
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #912 +/- ##
=======================================
Coverage 27.96% 27.96%
=======================================
Files 240 240
Lines 31712 31712
=======================================
Hits 8867 8867
Misses 22690 22690
Partials 155 155 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f01c8a1 to
51cd1ca
Compare
| @@ -1,4 +1,4 @@ | |||
| resource "equinix_fabric_network" "new_network" { | |||
| Fresource "equinix_fabric_network" "new_network" { | |||
There was a problem hiding this comment.
| Fresource "equinix_fabric_network" "new_network" { | |
| resource "equinix_fabric_network" "new_network" { |
| cat > consolidate_report.sh << 'EOF' | ||
| #!/bin/bash | ||
| python3 << 'PY' | ||
| import xml.etree.ElementTree as ET |
There was a problem hiding this comment.
Why wouldn't this just be a python script? executed with python3 filename.py?
There was a problem hiding this comment.
Didn't intend to add this file. Removed it.
| METAL_AUTH_TOKEN: ${{ secrets.METAL_AUTH_TOKEN }} | ||
| run: | | ||
| go test ./... -v -coverprofile coverage_pfcr.txt -covermode=atomic -count 1 -parallel 8 -run "(PFCR)" -timeout 180m | tee pfcr_test_output.log | ||
| go test ./internal/resources/fabric/network/... -json -v -coverprofile coverage_pfcr.txt -covermode=atomic -count 1 -parallel 8 -run "(PFCR)" -timeout 180m | tee pfcr_test_output.log |
There was a problem hiding this comment.
Note to change this back after drafting
bec4db3 to
444a9fb
Compare
9d094e6 to
12b2242
Compare
77d5fb8 to
76078c1
Compare
| @@ -0,0 +1,10 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
My understanding is that the TF Fabric PFCR acceptance tests and TF Fabric PFNV acceptance tests will each fail if the go test command run in that step fails, and that failure will be highlighted in the GitHub Actions workflow output with a failure icon next to the step name. It seems like establishing a practice of looking at the workflow output and/or results file when the test step failed is more straightforward than adding a separate step that mirrors the pass/fail status of the tests themselves.
| total_failing_tests=$(grep -oP 'failures="\K[0-9]+' uat_test_report.xml | head -n 1) | ||
|
|
||
| summary_html="<h1>Test Summary</h1> | ||
| <h2>Total Number of Tests: $total_tests</h2> |
There was a problem hiding this comment.
How does this summary differ from what is produced with the --summary-matrix flag for junit2html? https://gitlab.com/inorton/junit2html#advanced-usage
There was a problem hiding this comment.
--summary-matrix gives a summary of test run but does not give individual test output. So, it won't work in this case.
There was a problem hiding this comment.
It's not possible to use it in an existing report.
| - name: Create HTML Testing Report | ||
| run: | | ||
| cat pfcr_test_output.log pnfv_test_output.log > uat_test_report.log | ||
| go-junit-report -in uat_test_report.log > uat_test_report.xml && python3 -m junit2htmlreport uat_test_report.xml uat_test_report.html |
There was a problem hiding this comment.
Given that we have to install junit2htmlreport in order to do this conversion, I wonder if we might get a better experience out of using something like https://github.com/mikepenz/action-junit-report--or maybe https://github.com/javiertuya/junit-report-action, which appears to use ant directly rather than duplicating its reporting functionality.
77d5fb8 to
4dedcfe
Compare
b0da162 to
9747532
Compare

check_tests.shCreate HTML Reportstep.