-
Notifications
You must be signed in to change notification settings - Fork 323
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
Adds name attribute to <testcase> elements in junit output (#575) #576
Conversation
Fixes Issue #575 |
@hadley I believe I've fixed the test failures but it looks like neither AppVeyor nor Travis are rebuilding. |
Perhaps a different version of libxml is being used than to generate the original output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the checks pass for you locally?
R/reporter-junit.R
Outdated
@@ -89,7 +89,8 @@ JunitReporter <- R6::R6Class("JunitReporter", inherit = Reporter, | |||
name <- test %||% "(unnamed)" | |||
testcase <- xml2::xml_add_child(self$suite, "testcase", | |||
time = toString(time), | |||
classname = paste0(classnameOK(context), '.', classnameOK(name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind fixing the indenting while you're in here?
6ce3c07
to
e59544e
Compare
@hadley When I run <failure type="failure" message="expectation_failure in structure(list(fail()), start_frame = 19): Failure has been forced @reporters/tests.R#8"/> I would suggest removing the |
Yeah, that looks like a mistake anyway - "structure(list(fail()), start_frame = 19)" looks like a deparsed object, not something deliberately included. Can you remove it? |
I can't really follow the logic of the code that currently generates the message, and it's not clear to me what it should be, so I trust your judgement as to what would be more helpful. |
- "message" attribute mapped directly to expectation message - failure/error body set to format(expectation) This produces the same output as the summary reporter for errors/failures.
Matched the stack depth numbers to those output by the summary reporter.
This adds two options: * testthat.default_check_reporter: allows configuration of a different reporter to use for test_check(). For example, 'junit' * testthat.junit.output_file: specifies a file to which the junit xml should be written. These are needed so that Ci systems can run test scripts in R packages without modification, but first set these options() so that test output will be written to a known location where it can be read and parsed.
Phew. That seems to work now. I've added one more commit that allows CI systems to override the reporter used for test_check() and specify and output location for the junit reporter. |
Looks good. Now just needs a bullet in NEWS.md, and I can merge. |
Thanks! |
Improved output:
http://build.renjin.org/job/Replacement-Packages/job/testthat/11/testReport/