Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sfc-gh-abalik
Copy link
Contributor

@sfc-gh-abalik sfc-gh-abalik commented Jun 24, 2024

Fix for #285

With a ParameterizedTest it is possible to generate test case names with invalid XML characters. E.g.

@ParameterizedTest
@ValueSource(strings = {"Weird\bname"})
void testFoo(String input) {
    ...
}

The test case name is derived from the input string, which in this case contains an invalid XML char \b. When tools (like IDEs) try to parse the junit XML, they'll fail due to the invalid char.

Fix it by escaping test case names. It looks like test suite names could also contain invalid XML chars, so I'm escaping those as well.

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Thanks!

@illicitonion
Copy link
Collaborator

The CI failure is spurious, but is blocked on bazel-contrib/rules_jvm_external#1173 getting released - hopefully it will get released soon!

@sfc-gh-abalik
Copy link
Contributor Author

Looks like bazel-contrib/rules_jvm_external#1173 got released.
I think we just need to rebase after #288 is merged.

@shs96c
Copy link
Collaborator

shs96c commented Jul 12, 2024

@sfc-gh-abalik, with #288 we now have the CI builds working properly again. Could you please rebase on top of current HEAD of main so that we can land this change? Thank you for your patience as we were sorting that out!

@sfc-gh-abalik sfc-gh-abalik force-pushed the abalik-escape-illegal-chars branch from 21b018b to 4c3d6e4 Compare July 24, 2024 23:15
Copy link
Collaborator

@shs96c shs96c left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@shs96c shs96c merged commit a78287a into bazel-contrib:main Jul 29, 2024
@sfc-gh-abalik sfc-gh-abalik deleted the abalik-escape-illegal-chars branch July 29, 2024 17:41
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.

3 participants