Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code coverage reporting #1866

Merged
merged 4 commits into from
Jan 23, 2019
Merged

Add code coverage reporting #1866

merged 4 commits into from
Jan 23, 2019

Commits on Jan 22, 2019

  1. Add code coverage reporting

    https://artsyproduct.atlassian.net/browse/PLATFORM-1136
    
    Problem:
    
    One part of the product health matrix story [spike][spike] is code
    coverage for each service. However, there is no pattern at Artsy for
    measuring code coverage for Javascript applications.
    
    While there are existing tools out there for tracking and reporting code
    coverage, such as [istanbul.js][istanbul-js], [coveralls][coveralls],
    and [codecov][codecov], the complexities:
    
    1. A multi-runner test suite (jest and mocha), and
    2. A Circle CI -> Docker -> Docker test runtime
    
    have resulted in a tough problem to solution around.
    
    Solution:
    
    After spending a lot of time trying to get Coveralls instrumentation to
    work, we pivoted to using Codecov. At a high level, this commit does the
    following:
    
    1. Updates our calls to `jest` and `mocha` to write code coverage
    information to a `.nyc_output` directory (default for nyc/istanbul)
    
    2. Manipulates the `jest` coverage information to be compatible with
    `mocha` coverage information via a JS script. See [motivating GH
    issue][gh-issue].
    
    3. Merges the `jest` and `mocha` coverage information together using the
    `nyc` CLI
    
    4. Introduces a bash executable provided by codecov to instrument the
    merged information to codecov
    
    Co-authored-by: Kieran Gillen <[email protected]>
    
    [spike]:https://artsyproduct.atlassian.net/browse/PLATFORM-1098
    [istanbul-js]:https://github.com/istanbuljs/nyc
    [coveralls]:https://coveralls.io/
    [codecov]:https://codecov.io/gh/artsy/positron/
    [gh-issue]:jestjs/jest#2418
    dleve123 committed Jan 22, 2019
    Configuration menu
    Copy the full SHA
    0846650 View commit details
    Browse the repository at this point in the history
  2. Pass the branch name down to codecov

    * Add BRANCH_NAME to .env.test so that it's whitelisted for Docker
    * Pass through CIRCLE_BRANCH to `hokusai test`
    * Extend expression to `codecov` to take a branch name
    dleve123 committed Jan 22, 2019
    Configuration menu
    Copy the full SHA
    f8a9232 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2019

  1. Merge and removes unneeded lines from normalize jest coverage

    Kieran Gillen authored and Kieran Gillen committed Jan 23, 2019
    Configuration menu
    Copy the full SHA
    2a333f4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dcec5f0 View commit details
    Browse the repository at this point in the history