ampproject / ampproject/amphtml

Accurately measure code coverage during integration tests

Open
#22,682 3 comments 0 reactions 1 assignee Claimed by @rileyajones View on GitHub
P2: Soon Stale Type: Bug WG: infra
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Today, the code coverage measured by the integration tests is ~31%.

![Screenshot from 2019-06-04 14-03-07](https://user-images.githubusercontent.com/26553114/58902652-8211c400-86d1-11e9-8265-6c8a4845f21e.png)

This is inaccurate because we're not instrumenting the built runtime used in `commonIntegrationTestPaths`.

https://github.com/ampproject/amphtml/blob/aafa1512f2feb9b1528da1b3d8b380a8ad5eb8ae/build-system/config.js#L36-L62

Adding `istanbul` instrumentation via `browserify` to `gulp build` slows down the build by an order of magnitude and doesn't change the coverage measured (https://github.com/ampproject/amphtml/pull/22567#issuecomment-497122667). Not sure what else can be done, or if it's even feasible to measure code coverage for built JS files that are loaded by webpages during tests.

/cc @ampproject/wg-infra @aghassemi

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.