You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running 4 parallel steps in a Bitbucket pipeline. Each of those steps does a different thing - each builds and tests a different subproject. In one of those subprojects I'm trying to run ava test runner with one test file.
This condition will always evaluate in CI (at least that's the intention) and the ci-parallel-vars package used here will assign currentIndex to a value of BITBUCKET_PARALLEL_STEP env variable, and totalRuns to BITBUCKET_PARALLEL_STEP_COUNT.
In my case currentIndex evaluates to 3 and totalRuns to 4. That's invalid because I only execute the test in one of those parallel steps.
Then in lib/api.jsthere's this code:
if (this.options.parallelRuns) {
// ... truncated for brevity
selectedFiles = chunkd(selectedFiles, currentIndex, totalRuns);
// Evaluates as:
// selectedFiles = chunkd([x], 3, 4)
// which is an empty array
// ...
}
This way the only test file I have is being dropped and no tests are evaluated.
Expected behavior
I would expect to have an option to disable the CI parallel runs feature. Or maybe to provide custom values for currentIndex and totalRuns.
Workaround
The only workaround I found is to do this:
(unset BITBUCKET_PARALLEL_STEP; unset BITBUCKET_PARALLEL_STEP_COUNT; npm run test)
Our team has the same multi-project setup and we faced the same issue. It took some time to figure out why ava reported: "No files tested in this parallel run" even though the same command locally resulted in all tests being run. Maybe ava could print out some debug info in verbose mode if it's running just a subset of test cases.
@tuopppi what kind of info are you looking for? AVA already prints when it ran a subset of the test files in a parallel run, and also when it could not run any test files.
Situation
I'm running 4 parallel steps in a Bitbucket pipeline. Each of those steps does a different thing - each builds and tests a different subproject. In one of those subprojects I'm trying to run ava test runner with one test file.
Problem
However, in
lib/cli.js
we have this:This condition will always evaluate in CI (at least that's the intention) and the
ci-parallel-vars
package used here will assigncurrentIndex
to a value ofBITBUCKET_PARALLEL_STEP
env variable, andtotalRuns
toBITBUCKET_PARALLEL_STEP_COUNT
.In my case
currentIndex
evaluates to 3 andtotalRuns
to 4. That's invalid because I only execute the test in one of those parallel steps.Then in
lib/api.js
there's this code:This way the only test file I have is being dropped and no tests are evaluated.
Expected behavior
I would expect to have an option to disable the CI parallel runs feature. Or maybe to provide custom values for
currentIndex
andtotalRuns
.Workaround
The only workaround I found is to do this:
Context
I believe this is related to #1811 and #1812.
The text was updated successfully, but these errors were encountered: