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

Include working coverage script #2997

Merged
merged 7 commits into from Jul 16, 2019
Merged

Include working coverage script #2997

merged 7 commits into from Jul 16, 2019

Conversation

lukastaegert
Copy link
Member

@lukastaegert lukastaegert commented Jul 15, 2019

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
Resolves #227

Description

This includes a script to run tests with coverage.
TODO:

  • Run via CI
  • Integrate with some Github service for PRs

@TrySound
Copy link
Member

Are you gonna bundle babel with rollup? How big bundle with this change?

@lukastaegert
Copy link
Member Author

Babel is definitely not bundled and it is only a transitive devDependency via istanbul-lib-instrument and nyc anway. There should be not change for users of Rollup, both in Rollup's install size and the size of generated bundles. We should just make sure that we do not accidentally publish the instrumented Rollup bundle.

@lukastaegert
Copy link
Member Author

So to make it clear, this is only for Rollup's own coverage. If Rollup consumers need coverage, they need to set up something similar to what has been done in this PR.

@TrySound
Copy link
Member

Ah, great! Thanks for answer

@shellscape
Copy link
Contributor

This addresses #227. That issue is worth reviewing as there's some good info in it.

@codecov
Copy link

codecov bot commented Jul 16, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@db6979d). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2997   +/-   ##
=========================================
  Coverage          ?   87.51%           
=========================================
  Files             ?      165           
  Lines             ?     5718           
  Branches          ?     1728           
=========================================
  Hits              ?     5004           
  Misses            ?      438           
  Partials          ?      276

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db6979d...97db18e. Read the comment docs.

…cessary for nyc

(and we could have had this much earlier...)
@lukastaegert lukastaegert changed the title [WIP] Include working coverage script Include working coverage script Jul 16, 2019
@lukastaegert
Copy link
Member Author

@shellscape Since this is working really well now, I'll put it on master to be able to have coverage diff with master for other PRs. In the end it turns out the special instrumentation plugin was not really necessary as nyc is working really well with sourcemaps now, all we needed were additional sourcemaps for bin/rollup and a proper include/exclude .nycrc file. We could consider adding a coverage limit for PRs in the future though for now I'm happy with this being a tool for reference to spot untested code paths.

@lukastaegert lukastaegert merged commit b194d4a into master Jul 16, 2019
@lukastaegert lukastaegert deleted the include-coverage branch July 16, 2019 05:11
"ci:lint": "npm run lint:nofix && npm run security",
"ci:test": "npm run build:test && npm run build:bootstrap && npm run test:all",
"ci:test_12": "npm run build:test && npm run build:bootstrap && npm run test:only && npm run test:typescript",
"ci:coverage": "npm run build:test && nyc --reporter lcovonly mocha && codecov",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(late to the party, but I'll submit a PR for this)

We can eliminate the codecov dependency by adding this to the circle ci config on the last node version test:

      - run:
          name: Submit coverage data to codecov.
          command: bash <(curl -s https://codecov.io/bash)
          when: on_success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix code coverage reporting
3 participants