cukinia: filter junitxml output to only include valid xml 1.0 chars #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In running some hardware tests that use cukinia_cmd/cukinia_run_dir I ran a script that included "btattach" output. This includes invalid chars in XML 1.0. Jenkins will refuses to parse the output file.
The exact btattach output can be reproduced with:
tests/unicode/filtertest.sh
unicode.conf:
run:
This will return:
Jenkins will refuse to parse this with:
This commit uses tr to filter to only valid characters. I tested this with a few other examples:
Byte values 0-255:
Random:
Both of these pass after adding the tr filter. The downside to this method is that it is overly aggressive. This will break unicode that otherwise might be valid in xml 1.0/junitxml, but I'm not sure how else to filter this more carefully in only busybox / sh otherwise. I'm curious if there are thoughts on any better way to handle this.
The other solution I see to this are just requiring the tests to limit their own output. I could certainly make my test script silent if it succeeds, but the most valuable output is probably when it fails in surprising ways where I might want to see the unexpected output.