-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
implement --no-only flag functionality #572
Conversation
Co-authored-by: Joshua Ocrah <[email protected]> Co-authored-by: Jordan Harband <[email protected]>
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.
Since test files can be run with either tape test.js
or node test.js
, my hope would be that the env var would apply to both cases.
89e5e9b
to
3dbd17a
Compare
3dbd17a
to
0514e41
Compare
0514e41
to
a946e85
Compare
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 tried to improve this by passing an option explicitly into tape.run
, but because of the way the lazy loader works, i'm not sure how well that'd work.
o okay yea understood, also been trying to debug the exit code being |
ah right, forgot about that. i'll take a quick look locally. |
a946e85
to
5fef647
Compare
I see that 0.10 and 0.8 both have different kinds of failures, including some exit codes of 127. io.js v3.0-v3.2 seem to have similar failures. I'd prefer not to start making these fail, so let's look more into them. I've rebased on top of a commit that fixes the 16.9/16.10 failures. |
okay got it, thanks. Earlier today, tried 0.8 locally and did not get the tests introduced in this pr failing (I guess could depend on the specific patch version). Please do you mean some other tests failed also with the 127 exit code or these same tests? |
At this point (and we can check once CI is completed) i think all the remaining failures are:
The latter is my concern. |
so after trying locally, I see the iojs 3.0, 3.1 and 3.2 failures are related to some stack-buffer overflow error related to nodejs/node#2581, and fixed i think for latter versions? |
hmm, meaning what, that this one test file is triggering a bug, but no other test files have triggered it before? |
hmm, oddly enough locally v3.3 fails, but it passes in CI. |
hmm, when i run the test file by itself, it fails consistently for me locally, but when i run the full suite, it passes. That's concerning. |
ok, figured that last one out; when specifying |
adc1f22
to
eaaef47
Compare
Codecov Report
@@ Coverage Diff @@
## master #572 +/- ##
==========================================
+ Coverage 96.03% 96.36% +0.32%
==========================================
Files 4 4
Lines 631 632 +1
Branches 147 148 +1
==========================================
+ Hits 606 609 +3
+ Misses 25 23 -2
Continue to review full report at Codecov.
|
eaaef47
to
567b106
Compare
yea quite interesting. Looking at the already existing tests, I don't think we've had the use-case of testing the stderr output of any thrown error for those particular node versions (3.0,3.1 and so on) Locally ( on the master branch), I added a tape test file that had multiple I then tried to run a similar tap test (using the child process spawn) on the tape file using iojs 3.2, it still had the stack error instead of the expected error |
When I use iojs v3.2, and I run |
o okay interesting, yea most likely something around that. |
709aa1c
to
3c62af1
Compare
I've switched from spawn to exec; that seems like it'll fix it :-) |
okay seen, nice! |
then I think the main thing left will be the differences in error exit code now. Checking the iojs 3.2 build, I see failure is now related to an exit code of |
yeah, i locally changed the |
3c62af1
to
5b2a934
Compare
I went ahead and TODOd the tests for node 0.8, 0.10, and 3.0-3.2. |
5b2a934
to
2fb5a66
Compare
okay cool, this was fun 😄, thanks for the review and insights @ljharb |
Co-authored-by: Joshua Ocrah <[email protected]> Co-authored-by: Jordan Harband <[email protected]>
- [New] add `--no-only` flag/`NODE_TAPE_NO_ONLY_TEST` (#572) - [New] `t.match`/`t.doesNotMatch: fail the test instead of throw on wrong input types. - [Fix] `bin/tape`: delay requires until needed - [Robustness] use cached `.test` - [readme] hard wraps bad, soft wraps good - [readme] port changes from v5 - [meta] fix `prelint` so it does not fail outside of a git repo - [meta] better `eccheck` command - [meta] Exclude `fs` from browser bundles (#565) - [actions] reuse common workflows - [actions] update codecov uploader - [Deps] update `object-inspect`, `resolve`, `glob`, `is-regex`, `string.prototype.trim` - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `safe-publish-latest`, `array.prototype.flatmap` - [Tests] handle a broken error `cause` in node 16.9/16.10 - [Tests] handle carriage returns in stack traces on Windows
v4.15.0 - [New] add `--no-only` flag/`NODE_TAPE_NO_ONLY_TEST` (#572) - [New] `t.match`/`t.doesNotMatch: fail the test instead of throw on wrong input types. - [Fix] `bin/tape`: delay requires until needed - [Robustness] use cached `.test` - [readme] hard wraps bad, soft wraps good - [readme] port changes from v5 - [meta] fix `prelint` so it does not fail outside of a git repo - [meta] better `eccheck` command - [meta] Exclude `fs` from browser bundles (#565) - [actions] reuse common workflows - [actions] update codecov uploader - [Deps] update `object-inspect`, `resolve`, `glob`, `is-regex`, `string.prototype.trim` - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `safe-publish-latest`, `array.prototype.flatmap` - [Tests] handle a broken error `cause` in node 16.9/16.10 - [Tests] handle carriage returns in stack traces on Windows
Summary
This pr implements the functionality stated in #569.
How it works
By passing a
--no-only
flag while running tape tests (eg.tape **/*test.js --no-only
), anytest.only
unintentionally left in any of the tests causes an error to be thrown to make tests fail.This behaviour can alternatively be achieved by setting the environmental variable
NODE_TAPE_NO_ONLY_TEST
totrue
.