Uh oh!
There was an error while loading. Please reload this page.
tools: expose skip output to test runner - #2130
Conversation
In the TAP protocol, skips are flagged as ok. Expose more information so we can understand if the test was skipped or not.
There was a problem hiding this comment.
This should probably be a regex if there's any concern about actual TAP compliance. The Skipped only needs to match skip, and it shouldn't be case sensitive.
jbergstroem
commented
Jul 8, 2015
Yeah. String matching is questionable but since we're at least establishing a standard for this, I chose to go with the cheaper operation. The "right thing" to do here is creating a function that formats into tap input in Anyway, if more people agree that I should go regex I'll make it so. |
rmg
commented
Jul 8, 2015
I wouldn't worry about performance until it's a problem. An anchored regex is normally just as fast or faster than a string comparison because it gets compiled to a dfa (though that generally only matters for longer strings). The case insensitively would be the biggest cost regardless of the method used. |
jbergstroem
commented
Jul 8, 2015
⬆️ fixed |
`re` only matches on the first line unless told to do multiline.
There was a problem hiding this comment.
It is better to use raw strings for RegEx. Also, we can precompile and store the RegEx with re.compile
There was a problem hiding this comment.
Just a question, since I am about to touch this code too, where is the "# SKIP" output generated? Is it logged to stdout by the tests themselves?
There is also support in the test runner to do this with status files.
There was a problem hiding this comment.
Yes, the tests print '0..1 # Skipped: <reason>'.
jbergstroem
commented
Jul 8, 2015
Updated based on all feedback disregarding code style -- will update if we don't care about current conventions. |
rmg
commented
Jul 8, 2015
The regex appears to be fed a multiline blob of text.. does anything need to be done about only capturing the the end of the line? I would expect not but it has been a while since I used Python so I just wanted to point it out. |
jbergstroem
commented
Jul 8, 2015
@rmg as far as I know, |
jbergstroem
commented
Jul 8, 2015
jbergstroem
commented
Jul 9, 2015
Here's two skip's in output: https://jenkins-iojs.nodesource.com/job/iojs+pr+win/nodes=win2008r2/113/console (test 133, 134)
Edit: Works as intended, I was just a bit early to call it. |
There was a problem hiding this comment.
Hmmm, its better not to search twice. Why not use @bnoordhuis's suggestion #2130 (comment)?
There was a problem hiding this comment.
Because code conventions. I'll make it happen.
bnoordhuis
commented
Jul 9, 2015
Depends on whether you use
|
6725cba to
3749544Comparejbergstroem
commented
Jul 13, 2015
^ PTAL |
thefourtheye
commented
Jul 13, 2015
The original version had |
jbergstroem
commented
Jul 13, 2015
@thefourtheye yeah, represents whether the test suite should catch body output or not. I don't think too many people would turn that off. Reckon the regex is cheap enough or do we want to squeeze that extra cpu cycle? |
thefourtheye
commented
Jul 13, 2015
@jbergstroem Cool then. The RegEx looks fine and overall the code is readable to me. LGTM 👍 |
jbergstroem
commented
Jul 13, 2015
jbergstroem
commented
Jul 16, 2015
@bnoordhuis went ahead and did a similar suggestion to yours. Looking better? |
Fishrock123
commented
Jul 28, 2015
Is this good to land then? |
thefourtheye
commented
Jul 28, 2015
LGTM 👍, if the CI run is green. |
There was a problem hiding this comment.
Style nit: if it doesn't fit on a single line, maybe write it as:
logger.info(
'ok %i - %s # skip %s'% (self._done, command, skip.group(1)))bnoordhuis
commented
Jul 29, 2015
LGTM with nit and sorry for the delay. |
In the TAP protocol, skips are flagged as ok. Expose more information so we can understand if the test was skipped or not. PR-URL: #2130 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
jbergstroem
commented
Jul 30, 2015
Merged in 3cbb587. Thanks for the review. |
In the TAP protocol, skips are flagged as ok. Expose more information so we can understand if the test was skipped or not. Refs #2109.
(see http://testanything.org/tap-specification.html -> directives -> skipping tests)
/R=@nodejs/build, @bnoordhuis (keeps my python on track)