Comments (3)
Thank you for the report. As mentioned in the readme, karma-parallel may add additional tests to your output.
If this plugin discovers that you have focused some tests (fit, it.only, etc...) in other browser instances, it will add an extra focused test in the current browser instance to limit the running of the tests in the given browser. Similarly, when dividing up the tests, if there are not enough tests for a given browser, it will add an extra test to prevent karma from failing due to no running tests
Essentially, by the time we know that there is a focused describe block, it is too late to decide not to shard; we have already started up all the browsers instances and started parsing the tests. The only fail-safe way (that I know of) to tell mocha/jasmine to skip other tests, is by adding a focused test. Otherwise, shards that happen to not be delegated any focused tests will attempt to run all specs since it is unaware of any focused specs at all.
The spec that is running, is a very lightweight spec that does nothing at all. See:
https://github.com/joeljeske/karma-parallel/blob/v0.2.9/lib/karma-parallelizer.js#L142
from karma-parallel.
Makes sense, thanks!
from karma-parallel.
@joeljeske : we have a project set-up where we use karma-parallel with 5 executors to run ~8500 tests. Below is a snapshot of a successful run:
We have also set jasmine's failSpecWithNoExpectations to true in karma.conf.js file
client: {
jasmine: {
random: false,
failSpecWithNoExpectations: true
}
},
Recently, for one odd build on our CI/CD pipeline karma-parallel added the lightweight spec you mentioned above and since this spec does not has any expectation, it caused that build to fail:
I can understand additional tests introduced by karma-parallel in case of focused tests or not enough tests to be run for every executor instance. But why did this happen for our use case?
From the failure screenshot, it could be seen that 6956 tests were split up amongst shard-2, shard-3, shard-4 and shard-5. The left 1577 remaining tests should have been received by shard-1 and there was no need for karma-parallel to add any default test. So, what could be the reason for addition of default test in this particular case?
from karma-parallel.
Related Issues (20)
- karma-parallel do not return exit code 1 anymore on too low code coverage HOT 7
- Exception when using "karma run" HOT 7
- Should fail the test cases split to a browser that is disconnected HOT 4
- Aggregated Log Output HOT 10
- No support for Circle CI HOT 2
- Support Karma 4 HOT 1
- When browser disconnects, remaining tests are skipped HOT 5
- Random failures with uncaught errors and missing tests
- Jasmine test timeout is ignored HOT 1
- Random test failures during CI process
- How to enable running tests in parallel on CI
- Publish new version HOT 2
- No calculation of all passed tests on kubernetis -job
- Script Error while executing karma tests HOT 1
- Only supporting Jasmine ?
- Karma parallel cannot find any tests after starting Chrome
- Need help to get code coverage HOT 3
- `Parallel` throws away global beforeEach in multi-browser mode
- Is there a way to let what files to run in what threads/browser instances ?
- failSpecWithNoExpectations to true in jasmine and karma-parallel add the extra tests HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-parallel.