Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML CDATA section being ignored by test-results-action #652

Open
Molter73 opened this issue Feb 17, 2025 · 0 comments
Open

XML CDATA section being ignored by test-results-action #652

Molter73 opened this issue Feb 17, 2025 · 0 comments

Comments

@Molter73
Copy link

Describe the bug
I'm generating junit test reports using the go-junit-report tool which prints the stacktrace as a CDATA section in the XML output, looking something like this:

                <testcase name="TestProcessNetwork/TestProcessViz" classname="" time="0.000">
                        <failure message="Failed"><![CDATA[    process_network.go:119:
                Error Trace:    /tests/suites/process_network.go:119
                Error:          Test failure
                Test:           TestProcessNetwork/TestProcessViz
2025/02/17 13:04:51 INFO: logs container-stats (443 bytes stdout, 0 bytes stderr)
2025/02/17 13:04:51 WARN: missing name for stat line 0 of 1
2025/02/17 13:04:51 INFO: TestProcessNetwork: Gathering logs for "container-stats"
2025/02/17 13:04:51 INFO: logs container-stats (443 bytes stdout, 0 bytes stderr)
2025/02/17 13:04:51 INFO: Writing container-logs/cos_cos-beta/core_bpf/perf.json
2025/02/17 13:04:52 INFO: TestProcessNetwork: Gathering logs for "nginx"
2025/02/17 13:04:52 INFO: logs nginx (91 bytes stdout, 0 bytes stderr)
2025/02/17 13:04:52 INFO: TestProcessNetwork: Gathering logs for "nginx-curl"
2025/02/17 13:04:52 INFO: logs nginx-curl (0 bytes stdout, 0 bytes stderr)
2025/02/17 13:04:55 INFO: TestProcessNetwork: Gathering logs for "collector"
2025/02/17 13:04:55 INFO: logs collector (0 bytes stdout, 30497 bytes stderr)]]></failure>
                </testcase>

The generated PR comment does show the test has failed with the Failed message, but the stacktrace seems to be missing
stackrox/collector#2044 (comment)

Environment (please complete the following information):

  • Fully running on GitHub Actions.

To Reproduce
Steps to reproduce the behavior:

  1. Run some go tests and process them with go-junit-report as suggested in its README: go test -v 2>&1 ./... | go-junit-report -set-exit-code > junit.xml
  2. Upload the report with the codecov/test-results-action GHA action.

Expected behavior
The generated PR comment should have the stacktrace as part of its body.

@covecod covecod bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Development

No branches or pull requests

1 participant