Skip to content

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

@Molter73

Description

@Molter73

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions