-
Notifications
You must be signed in to change notification settings - Fork 226
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
Need proper handling for invalid character for CDATA field #138
Comments
Thanks. It sounds like we should at least strip the invalid characters from the CDATA section. However, since ANSI escape sequences also contain regular characters we'd probably want to strip the entire ANSI sequence rather than just the (invalid) control characters. |
I just ran into the same issue with Jenkins
|
Same here, I've tried to update to v2 stackrox/stackrox#2586 and prow does not parse XML as it's not valid.
|
@janisz Where do these invalid bytes come from, this doesn't look like an ansi escape character. Any concerns if they are just dropped completely from the output? |
This bytes came from key that is logged. Key is generated as Minimal example: package main
import "testing"
func TestEscape(_ *testing.T) {
println("Test '\x00'")
} $ go test ./... -v 2>&1 | go-junit-report -set-exit-code | file -bi -
+ Actual : application/octet-stream; charset=binary
- Expected: text/xml; charset=us-ascii |
Created a PR to drop control characters from output #140 |
Leaving this issue open for now, because it would be nice if we could also detect ANSI escape sequences and remove them from the output. |
@TafThorne what version are you using? I thought special characters will be replaced with #140 |
I ran with the latest v2 tagged code I think:
So that would be v2.0.0 7fde464 which is from Jul 1, 2022. I can try to repeat with the latest code on master and see if it fixes it... one second.... |
It was more than a second but I can confirm that by using the latest changes on main things worked correctly for me.
The above are the details of the changeset that worked for me. Is there a plan to release some kind of 2.0.1 set of bug fixes or similar in the near future or should I wait for the 2.1.0 release I can see pencilled in? |
When output tests contains colored output log that may include escape character (0x1b) on test output report, the escape character is not treated well by
encoding/xml
package for CDATA section, so it will generate invalid XML document (as spec), that may result the test report being unreadable by the CI (in my case GitLab CI).Related issue: golang/go#53728
The text was updated successfully, but these errors were encountered: