-
Notifications
You must be signed in to change notification settings - Fork 621
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
Test runner v2 #604
Test runner v2 #604
Conversation
@nayeemrmn can you update the tests to present the new behavior of match? Also, I'm still convinced we should fail test run if no matching files are found (surely, a flag to disable this behavior can be added, but the default should fail), so if you could add that option as well. |
@bartlomieju @lucacasonato I suggest landing #599 first. |
7b83407
to
77feacc
Compare
2237ce5
to
d00887e
Compare
40bd039
to
6bacb5f
Compare
@bartlomieju I think this is ready. Could I get another review? cc @ry |
Is there a specific reason for having |
@sholladay When the number of tests is dynamic somehow, or someone wants their infrastructure up before they have any tests? Maybe that's contrived 😅 While it makes sense practically, I just think that failing when no tests are run is 'illogical' enough that there should be a way of at least overriding it. |
7567f35
to
a494bec
Compare
6c1b4bf
to
31204c9
Compare
@ry PTAL |
Look like a nice clean up. Just a couple comments... I'll land when @bartlomieju approves. |
@bartlomieju Ready. |
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.
LGTM, let's see this in action 💪
c9ccba0
to
bfb6423
Compare
bfb6423
to
b421efd
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.
LGTM - nice clean up
fs/glob.ts: - Improve prototypes for expandGlob() and expandGlobSync() from denoland#604. - Rename glob() to globToRegExp(). - Add normalizeGlob() and joinGlobs(). - Extract GlobToRegExpOptions from GlobOptions, remove the strict and filepath options. fs/globrex.ts: - Add GlobrexOptions. fs/path/constants.ts: - Add SEP_PATTERN. fs/walk.ts: - Add WalkOptions:includeFiles - Default WalkOptions::includeDirs to true. - Don't traverse directories matching a skip pattern. - Remove walkSync()'s default root value. prettier: - Refactor to use expandGlob(). testing: - Make findTestModules() an async generator.
fs/glob.ts: - Improve prototypes for expandGlob() and expandGlobSync() from denoland#604. - Rename glob() to globToRegExp(). - Add normalizeGlob() and joinGlobs(). - Extract GlobToRegExpOptions from GlobOptions, remove the strict and filepath options. fs/globrex.ts: - Add GlobrexOptions. fs/path/constants.ts: - Add SEP_PATTERN. fs/walk.ts: - Add WalkOptions::includeFiles - Default WalkOptions::includeDirs to true. - Don't traverse directories matching a skip pattern. - Remove walkSync()'s default root value. prettier: - Refactor to use expandGlob(). testing: - Make findTestModules() an async generator.
fs/glob.ts: - Improve prototypes for expandGlob() and expandGlobSync() from #604. - Rename glob() to globToRegExp(). - Add normalizeGlob() and joinGlobs(). - Extract GlobToRegExpOptions from GlobOptions, remove the strict and filepath options. fs/globrex.ts: - Add GlobrexOptions. fs/path/constants.ts: - Add SEP_PATTERN. fs/walk.ts: - Add WalkOptions::includeFiles - Default WalkOptions::includeDirs to true. - Don't traverse directories matching a skip pattern. - Remove walkSync()'s default root value. prettier: - Refactor to use expandGlob(). testing: - Make findTestModules() an async generator.
fs/glob.ts: - Improve prototypes for expandGlob() and expandGlobSync() from denoland/std#604. - Rename glob() to globToRegExp(). - Add normalizeGlob() and joinGlobs(). - Extract GlobToRegExpOptions from GlobOptions, remove the strict and filepath options. fs/globrex.ts: - Add GlobrexOptions. fs/path/constants.ts: - Add SEP_PATTERN. fs/walk.ts: - Add WalkOptions::includeFiles - Default WalkOptions::includeDirs to true. - Don't traverse directories matching a skip pattern. - Remove walkSync()'s default root value. prettier: - Refactor to use expandGlob(). testing: - Make findTestModules() an async generator. Original: denoland/std@8c90bd9
Currently, a directory argument will match every file in that directory which would never be useful (and the way it's implemented is the cause of denoland/deno#2948). We only get to benefit from the default globs when no arguments are given, so they have to be written out manually unless you want the exact set of files matched by just
deno test
. See denoland/deno#2948 (comment).This change will make it so that any directory given as - or expanded from - an argument is interpreted as a root on which to apply the default globs. Such an API would be more ergonomic and introduce some desirable properties. See #601 (comment).
The test runner will fail by default if no tests are found. Override this with a flag.
Other API changes:
//testing/runner.ts
:Add
runTestModules()
andRunTestModulesOptions
, renamegetMatchingUrls()
tofindTestModules()
.//fs/mod.ts
:Rename
RunOptions
toRunTestsOptions
.//fs/glob.ts
:Add
expandGlob()
,expandGlobSync()
andExpandGlobOptions
. These are prototypes extracted from the test runner.//fs/path/constants.ts
:Add
SEP
.