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

setup code coverage #60

Closed
16 of 19 tasks
ssube opened this issue Dec 19, 2018 · 2 comments
Closed
16 of 19 tasks

setup code coverage #60

ssube opened this issue Dec 19, 2018 · 2 comments
Labels
scope/build status/fixed issues that have been fixed and confirmed
Projects
Milestone

Comments

@ssube
Copy link
Owner

ssube commented Dec 19, 2018

Summary

Typescript and Istanbul have issues (microsoft/TypeScript#24993) working together, but the nyc tool should support source maps if they have the correct paths.

Scope

  • make target
    • instrument with nyc
    • execute test bundle with instrumented main bundle
    • exclude node_modules and out, include src and test
    • gather test results
  • source maps
    • ext file for each bundle
    • correct path in bundle
    • istanbul/nyc load maps
    • include in npm bundle
  • upload results to code climate
    • token
    • tool image (if necessary)
    • pipeline job
  • set up codecov
    • repo setup
    • token
    • upload job
    • github required check

Use Case

Feature-driven tests are great, but coverage shows you dead code. To keep the bot lean as it grows, comprehensive tests and aggressive removal of unused code is vital.

Issues

Huge time sink, but very useful.

@ssube ssube added status/planned issues that have been planned but not started scope/build labels Dec 19, 2018
@ssube ssube added this to the 1.0 - stable milestone Dec 19, 2018
@ssube ssube self-assigned this Dec 19, 2018
@ssube ssube added this to Planned in development Dec 19, 2018
@ssube
Copy link
Owner Author

ssube commented Dec 23, 2018

Current test harness only includes files from src/ with some test coverage, leaving most of them out :( and skewing results too high :( . Either the --all argument to nyc or including src via webpack context should work, but node_modules and the out stubs still need to be excluded.

Until istanbuljs/nyc#953 is resolved, including sources leads to node_modules being instrumented, which runs indefinitely.

@ssube ssube added status/blocked in-progress issues that are blocked by a dependency and removed status/planned issues that have been planned but not started labels Dec 23, 2018
@ssube ssube moved this from Planned to Blocked in development Dec 23, 2018
@ssube ssube mentioned this issue Dec 23, 2018
2 tasks
@ssube ssube modified the milestones: 1.0 - stable, 1.x - future Jan 6, 2019
@ssube ssube removed their assignment Jan 12, 2019
ssube added a commit that referenced this issue Jan 14, 2019
enable test coverage
@ssube ssube closed this as completed Jan 14, 2019
@ssube ssube added status/fixed issues that have been fixed and confirmed and removed status/blocked in-progress issues that are blocked by a dependency labels Jan 14, 2019
@ssube
Copy link
Owner Author

ssube commented Jan 14, 2019

Working for now with the written tests and their included sources, but nyc itself is still including node_modules. Following up in their issues, using sed as a workaround to remove modules and webpack extras from lcov report before uploading. CI is set up with coverage, but numbers are high (not all src is included, only that imported by tests).

@ssube ssube moved this from Blocked to Closed in development Jan 15, 2019
@ssube ssube modified the milestones: 1.x - future, 1.0 - stable Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/build status/fixed issues that have been fixed and confirmed
Projects
development
  
Closed
Development

No branches or pull requests

1 participant