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

Add options scope to junitreporter #1885

Merged
merged 3 commits into from
Oct 19, 2023
Merged

Add options scope to junitreporter #1885

merged 3 commits into from
Oct 19, 2023

Conversation

maksymiuks
Copy link
Contributor

Resolves #1660

According to @hadley's suggestions, I just enforced the decimal operator as an option scoped to the entire function. With that change, JUnit file should always be valid regardless of the decimal separator option used in the test.

Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

NEWS.md Outdated
@@ -54,6 +54,9 @@

* `test_file()` gains a `desc` argument which allows you to run a single
test from a file (#1776).

* `JunitReporter()` now uses ensures numeric values are saved the xml file
Copy link
Member

Choose a reason for hiding this comment

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

Can you please put this under the development version heading?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sorry, my bad, didn't spot that there are 2 versions back to back. Want me to copy the same subsection structure (## Lifecycle changes, ## New features etc.) or just put it under the development version and that's it?

Copy link
Member

Choose a reason for hiding this comment

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

No, just copy the bullet. We add the subsections as part of the release process.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, done :)

xml2::xml_attr(self$suite, "tests") <- as.character(self$tests)
xml2::xml_attr(self$suite, "skipped") <- as.character(self$skipped)
xml2::xml_attr(self$suite, "failures") <- as.character(self$failures)
xml2::xml_attr(self$suite, "errors") <- as.character(self$errors)
#jenkins junit plugin requires time has at most 3 digits
xml2::xml_attr(self$suite, "time") <- as.character(round(self$suite_time, 3))

Copy link
Member

Choose a reason for hiding this comment

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

Could you please get rid of these spurious whitespace changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Thanks

Comment on lines 88 to 89
# Make sure that any options posed by particular tests environments
# will not interfere with how values are saved to the file
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Make sure that any options posed by particular tests environments
# will not interfere with how values are saved to the file
# Always uses . as decimal place in output regardless of options set in test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Thanks

@hadley hadley merged commit 5550c98 into r-lib:main Oct 19, 2023
12 checks passed
@hadley
Copy link
Member

hadley commented Oct 19, 2023

Thanks!

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.

Junit reporter does not use standard decimal separator
2 participants