Skip to content

Only add frontend code coverage instrumentation when generating coverage report

username-removed-636429 requested to merge make-karma-fast-again into master

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?

What are the relevant issue numbers?

Merge request reports