-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add extra parameter: runTestsByPath. Fixes #4396 #4411
Conversation
@@ -162,6 +162,18 @@ class SearchSource { | |||
}; | |||
} | |||
|
|||
findTests(paths: Array<Path>): SearchResult { | |||
require('fs').writeFileSync('/tmp/lep', paths); |
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.
nope
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.
🤦🏻♂️
@@ -39,19 +39,18 @@ const getTestPaths = async ( | |||
) => { | |||
const source = new SearchSource(context); | |||
let data = await source.getTestPaths(globalConfig, changedFilesPromise); | |||
if (!data.tests.length) { |
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.
lol how did that happen
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.
probably me refactoring it last time and giving up on reading all if/else conditions :D
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.
That's because this if
is useless.
this._context, | ||
paths | ||
.map(p => path.resolve(process.cwd(), p)) | ||
.filter(this.isTestFilePath.bind(this)), |
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.
What happens if it can't find any tests, what does the message look like and does it make sense?
I'll buy a test for 100 internet points. |
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.
can you write an integration test for it?
@@ -162,6 +162,18 @@ class SearchSource { | |||
}; | |||
} | |||
|
|||
findTests(paths: Array<Path>): SearchResult { |
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.
can it be findTestsByPaths
?
@cpojer that's called bitcoins nowadays |
Changed name from |
Tests still failing. |
Codecov Report
@@ Coverage Diff @@
## master #4411 +/- ##
==========================================
- Coverage 56.84% 56.66% -0.19%
==========================================
Files 191 191
Lines 6475 6493 +18
Branches 5 5
==========================================
- Hits 3681 3679 -2
- Misses 2791 2811 +20
Partials 3 3
Continue to review full report at Codecov.
|
@cpojer Looked at the error messages when failing and added an additional |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This option adds an extra
runTestsByPath
parameter into the CLI. The goal of the parameter is to be able to execute tests by directly giving their path. Since the non-prefixed arguments right now are understood as patterns for file paths, this kind of worked, but when having more than 5k tests, the matching is quadratic and then it becomes unfeasible.