Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Junit reporter does not use standard decimal separator #1660

Copy link
Copy link
@maksymiuks

Description

@maksymiuks
Issue body actions

Hi,

I identified the following issue while trying to read back a junit file created for ggplot2 test suite. In this package, one of the tests is executed with a different option for decimal separator (https://github.com/tidyverse/ggplot2/blob/main/tests/testthat/test-aes.r#L19-L25). Therefore when testthat collects junit data it uses an altered option and due to the as.character() time is saved using a comma as separator (

xml2::xml_attr(self$suite, "time") <- as.character(round(self$suite_time, 3))
). Because of that, I'm receiving coercing error while trying to read it back.

In the case of the come, the issue is not that huge, but it sep option can be set to an arbitrary sign rendering the time field useless to read back for someone unaware. As the issue comes from the as.character(), I suggested the following change

xml2::xml_attr(self$suite, "time") <- withr::with_options(list(OutDec = "."), as.character(round(self$suite_time, 3)))

thanks to that we won't compromise any test environment but at the same time always get numbers in a standard format recognizable by any system - with point as decimal separator. I've checked and withr is already a dependency so it won't add any new.

Let me know what you think about this suggestion, I'm happy to prepare a PR if you agree with my evaluation and approach.

dgkf

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.