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

fix: junit testresult file generation #285

Merged
merged 12 commits into from
Oct 6, 2022
Merged

fix: junit testresult file generation #285

merged 12 commits into from
Oct 6, 2022

Conversation

randi274
Copy link
Contributor

@randi274 randi274 commented May 17, 2022

What does this PR do?

Resolved an issue where the junit file generation created invalid XML files, because the failure message
contains characters that should be XML-escaped. These are: <, >, &, " and '.
Made sure to xml-encode these in the message, updated a test case to make sure that this is now covered in
a test as well.

What issues does this PR fix or reference?

This PR fixes the following issue: #280
forcedotcom/cli#1183

Functionality Before

The junit generated created invalid XML, because XML characters like the quote were not properly escaped.

Functionality After

Valid XML generation

* fix: fix junit testresult file generation

Resolved an issue where the junit file generation created invalid XML files, because the failure message
contains characters that should be XML-escaped. These are: <, >, &, " and '.
Made sure to xml-encode these in the message, updated a testcase to make sure that this is now covered in
a test as well.
* fix: fix junit testresult file generation

Additional commit to also escape the method name, it can be '<compile>' when testcases fail because of
compilation errors. The '<' and '>' characters also need to be escaped in that case.
@randi274 randi274 requested a review from gbockus-sf May 17, 2022 15:32
@randi274 randi274 requested a review from a team as a code owner May 17, 2022 15:32
Copy link
Contributor

@gbockus-sf gbockus-sf left a comment

Choose a reason for hiding this comment

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

👍

@randi274 randi274 merged commit 39afd96 into main Oct 6, 2022
@randi274 randi274 deleted the pr/279 branch October 6, 2022 21:24
klewis-sfdc pushed a commit that referenced this pull request Oct 24, 2022
Resolved an issue where the junit file generation created invalid XML files, because the failure message
contains characters that should be XML-escaped. These are: <, >, &, " and '.
Made sure to xml-encode these in the message, updated a testcase to make sure that this is now covered in
a test as well.

Additional commit to also escape the method name, it can be '<compile>' when testcases fail because of
compilation errors. The '<' and '>' characters also need to be escaped in that case.

Co-authored-by: Johannes Verelst <[email protected]>
WillieRuemmele pushed a commit that referenced this pull request Jan 31, 2023
Resolved an issue where the junit file generation created invalid XML files, because the failure message
contains characters that should be XML-escaped. These are: <, >, &, " and '.
Made sure to xml-encode these in the message, updated a testcase to make sure that this is now covered in
a test as well.

Additional commit to also escape the method name, it can be '<compile>' when testcases fail because of
compilation errors. The '<' and '>' characters also need to be escaped in that case.

Co-authored-by: Johannes Verelst <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants