Skip to content

fix: HTML Test Report Improvements#912

Closed
d-bhola wants to merge 0 commit into
mainfrom
CXF-112855-html-report
Closed

fix: HTML Test Report Improvements#912
d-bhola wants to merge 0 commit into
mainfrom
CXF-112855-html-report

Conversation

@d-bhola
Copy link
Copy Markdown
Contributor

@d-bhola d-bhola commented Jun 20, 2025

  • Added check_tests.sh
  • Update Create HTML Report step.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.96%. Comparing base (91ca477) to head (b0da162).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@displague displague left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@d-bhola what's the intent of this PR? (for the PR description)

@@ -1,4 +1,4 @@
resource "equinix_fabric_network" "new_network" {
Fresource "equinix_fabric_network" "new_network" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Fresource "equinix_fabric_network" "new_network" {
resource "equinix_fabric_network" "new_network" {

Comment thread scripts/check_tests.sh Outdated
Comment thread scripts/consolidated_report.sh Outdated
cat > consolidate_report.sh << 'EOF'
#!/bin/bash
python3 << 'PY'
import xml.etree.ElementTree as ET
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wouldn't this just be a python script? executed with python3 filename.py?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't intend to add this file. Removed it.

Comment thread .github/workflows/fabric_acctest.yml Outdated
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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to change this back after drafting

@d-bhola d-bhola force-pushed the CXF-112855-html-report branch from bec4db3 to 444a9fb Compare June 27, 2025 21:34
@d-bhola
Copy link
Copy Markdown
Contributor Author

d-bhola commented Jun 30, 2025

@d-bhola d-bhola force-pushed the CXF-112855-html-report branch from 77d5fb8 to 76078c1 Compare June 30, 2025 16:37
Comment thread scripts/check_tests.sh Outdated
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/fabric_acctest.yml Outdated
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>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this summary differ from what is produced with the --summary-matrix flag for junit2html? https://gitlab.com/inorton/junit2html#advanced-usage

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--summary-matrix gives a summary of test run but does not give individual test output. So, it won't work in this case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@d-bhola d-bhola force-pushed the CXF-112855-html-report branch 3 times, most recently from 77d5fb8 to 4dedcfe Compare July 1, 2025 21:14
@tutkat tutkat closed this Jul 16, 2025
@tutkat tutkat force-pushed the CXF-112855-html-report branch from b0da162 to 9747532 Compare July 16, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants