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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to nyc, babel-plugin-istanbul & codecov-node for code coverage #4740

Closed
wants to merge 5 commits into from

Conversation

motiz88
Copy link
Contributor

@motiz88 motiz88 commented Oct 17, 2016

Q A
Bug fix? no
Breaking change? no
New feature? no
Deprecations? no
Spec compliancy? no
Tests added/pass? no (well they pass)
License MIT

The key benefit of this setup, apart from using the newer tools (same as Babylon has used for a while) is that coverage is now referenced to src/ rather than lib/, so the correct source shows up on Codecov, hopefully getting us to #1851 faster 馃槈

Thanks @bcoe for releasing istanbuljs-archived-repos/istanbul-lib-instrument#26 so quickly!


As I've mentioned on Slack - this currently causes a double build on CI, once during make bootstrap and once during make test-cov. This is not ideal and I'm hoping someone can weigh in on whether we need to build in make bootstrap at all.

@motiz88 motiz88 added area: tests PR: Internal 馃彔 A type of pull request used for our changelog categories labels Oct 17, 2016
@codecov-io
Copy link

codecov-io commented Oct 17, 2016

Current coverage is 89.95% (diff: 100%)

Merging #4740 into master will increase coverage by 0.63%

@@             master      #4740   diff @@
==========================================
  Files           196        196           
  Lines         13784      10227   -3557   
  Methods        1434       1122    -312   
  Messages          0          0           
  Branches       3199       2691    -508   
==========================================
- Hits          12312       9200   -3112   
+ Misses         1472       1027    -445   
  Partials          0          0           

Powered by Codecov. Last update 2b6ff53...3421983

@danez
Copy link
Member

danez commented Oct 17, 2016

The only big problem that we have then (and we currently also have in babylon) is that not all files show up in the reports. Only the files that are required at least once.
istanbuljs/babel-plugin-istanbul#4
So it could be that we reach 100% but still have uncovered files.

@motiz88
Copy link
Contributor Author

motiz88 commented Oct 17, 2016

@danez Oh. I think I knew about that problem and then forgot about it. Gonna have a look.

@motiz88
Copy link
Contributor Author

motiz88 commented Oct 22, 2016

Just a quick update - I'm doing some work on nyc and istanbul-lib-instrument (also been back full-circle to Babel with #4746 馃槃) to fix the problem @danez mentioned above. My test repo motiz88/nyc-all-demo ties everything together and has links to the gory details.

@bcoe
Copy link
Contributor

bcoe commented Oct 30, 2016

@motiz88 @danez @hzoo, we've landed changes to istanbul-lib-instrument and nyc, such that --all should now work for babel-plugin-istanbul 馃憤

This is currently published to the next branch on npm, and I would love the extra help testing:

npm cache clear; npm i nyc@next babel-plugin-istanbul@latest

My configuration and test-script look like this, in the testing project I've been using:

cross-env NODE_ENV=test nyc --all --show-process-tree --silent mocha test/*.js

  {"babel": {
    "presets": [
      "es2015"
    ],
    "env": {
      "test": {
        "plugins": [
          "istanbul"
        ]
      }
    }
  },
  "nyc": {
    "include": [
      "src/**/*.js"
    ],
    "exclude": [
      "node_modules"
    ],
    "require": [
      "babel-register"
    ],
    "sourceMap": false,
    "instrument": false
  }}

Thanks for everyone's help and feedback regarding this feature; it will be awesome to babel using nyc, which I think will in turn help make nyc significantly better.

@bcoe
Copy link
Contributor

bcoe commented Nov 18, 2016

@motiz88 @danez everything necessary to land this with --all support should now be landed;

You might find yourself wanting to fiddle with cache settings for a large codebase like this though.

@hzoo
Copy link
Member

hzoo commented Dec 2, 2016

Merged this via #4885

@hzoo hzoo closed this Dec 2, 2016
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: tests outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 馃彔 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants