Only add frontend code coverage instrumentation when generating coverage report
What does this MR do?
Improves the compile and execution time of the karma test suite by only including the code coverage instrumentation when we intend to generate a code coverage report.
Now there is a separate yarn task for generating coverage. Running yarn karma
or yarn karma-start
will just run the tests, and yarn karma-coverage
will generate the coverage report.
Are there points in the code the reviewer needs to double check?
Ensure the coverage-javascript
artifacts are still generated in CI.
Why was this MR needed?
Karma was starting to run slowly in development due to a bunch of coverage instrumentation being loaded into every file. When we aren't checking code coverage, this overhead is unnecessary.
On my MacBook Pro (2.5 GHz Intel Core i7) the time for yarn karma
was reduced from 60.67s to 38.76s.
Screenshots (if relevant)
n/a
Does this MR meet the acceptance criteria?
-
Changelog entry added [ ] Documentation created/updated[ ] API support added- Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together