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
Support for repeating test files with multiple env settings #586
Comments
I've actually been kicking around in my head lately the idea of defining a test matrix, like you would on Travis or CircleCI. I have a bunch of modules that I test in latest node, then run |
How would nyc (specifically spawn-wrap) react to having multiple versions of node.js run within? I have been thinking about giving nyc a way to bypass spawn-wrap. So an option where instead of running spawn-wrap the master nyc process would use |
I'd probably just run each item in the matrix in a separate NYC invocation. Tap already manages NYC usage, so this wouldn't be too hard. But yeah, if you did |
In the case of graceful-fs I think it would be important for coverage from both env's to be merged otherwise it wouldn't reach 100% branch coverage. |
Yeah, they'd be run with |
OK cool. So I guess the only other question is how would parallel work ( |
While writing a comment in the package.json overrides RFC I realized that it's probably a footgun to have tap able to run tests against multiple versions of node.js - node_modules installed by node 6 isn't always the same as node_modules installed by node 8 (I think this is already an issue for native modules). Not sure maybe you're suggesting that node_modules be deleted and reinstalled when switching node versions but then that would generally delete tap itself. |
Yeah, this feels like a job for CI. |
As you know I've been working on
graceful-fs
lately. I'd love the eliminate the./test.js
file which callstap.spawn
in a loop. The ability to telltap
to loop over a list of environment overrides would be extremely helpful to this. Mock package.json setup:In this case I'd want
tap
to serially run all test files twice, ornpx tap test/close.js
would run that one file twice. For test/close.js only I'd expect an output like:Where
test/close.js
would be run with normal env,test/close.js [🐵]
would be run with the additional value added toprocess.env
. For this feature I'd expect that lack ofenvs
would do the same asenvs = [{}]
, that is only run once with nothing added to the test id's or default env. I'd think it would normally be expected that at most one entry inenvs
exclude theid
, not sure if that would necessarily have to be a hard rule. I'm not sure ifenvs = []
should be an error or simply ignored.The text was updated successfully, but these errors were encountered: