-
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
Handle skipped tests in TAP reporter #262
Conversation
Ok, tests for the TAP reporter output added, including a test for the skip directive. This should increase test coverage, though the coveralls job in https://travis-ci.org/hadley/testthat/builds/64178838 timed out (which appears to be why the Travis build was marked as failing; the tests passed). |
test_that("TAP reporter handles context and pass/fail/skip", { | ||
filename <- tempfile(fileext="tap") | ||
sink(filename) | ||
test_dir("test_dir", reporter = "tap") |
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.
I think you could simplify this with capture.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.
Yes, thanks, much nicer.
Could you please also add a bullet point to NEWS? |
Thanks! (For future reference, I don't get a notification when you make changes, just when you make comments, so once you're done, it's helpful to add a comment like "PTAL") |
Ah ok, thanks for pointing that out, will do. |
Looks like the NEWS bullet I added was clobbered in a merge: nealrichardson/testthat@master...hadley:master#diff-8312ad0561ef661716b48d09478362f3L10 I could make a new PR with that if you want, but maybe it's easier for you to just add it back. |
Because
skip
ped tests did not haveresult$passed
, they were marked as "not ok" in the TAP output. Following http://testanything.org/tap-specification.html, I added a skip directive to the output in case ofresult$skipped
.I'd happily write a test for this change if you could indicate where that should be. I didn't find any tests for the reporter output, only for the existence of reporters. I did confirm that the output with the skip directives is correctly parsed, at least by the Jenkins TAP parser: