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

Instructions for running unit tests and generating coverage reports are out of date #6740

Closed
alxndrsn opened this issue Sep 7, 2017 · 5 comments

Comments

@alxndrsn
Copy link
Member

alxndrsn commented Sep 7, 2017

https://github.com/pouchdb/pouchdb/blob/master/TESTING.md#unit-tests references build-as-modular-es5, which no longer exists.

@alxndrsn
Copy link
Member Author

alxndrsn commented Sep 7, 2017

This also affects the documentation for generating coverage reports.

@alxndrsn alxndrsn changed the title Instructions for running unit tests are out of date Instructions for running unit tests and generating coverage reports are out of date Sep 14, 2017
@alxndrsn
Copy link
Member Author

Fuller explanation ref. unit tests:

https://github.com/pouchdb/pouchdb/blob/master/TESTING.md#test-coverage says to run $ npm run test-coverage. However, doing that locally gives different results to Travis - Travis expects 100% coverage, but locally on master I get:

=============================== Coverage summary ===============================
Statements   : 87.35% ( 5053/5785 ), 170 ignored
Branches     : 82.71% ( 2502/3025 ), 149 ignored
Functions    : 85.23% ( 935/1097 ), 22 ignored
Lines        : 87.34% ( 5048/5780 )
================================================================================

In the TESTING.md linked above, there's a hint that you need to run a script before running the coverage report:

Again, this uses npm run build-as-modular-es5 in order to fully test the codebase as a non-bundle. See build-as-modular-es5.sh for details.

However, I think this script was removed last year in this commit:

 commit 37fe1bc5a482b230fe9aa810a5419cbcde06da40
 Author: Nolan Lawson <nolan.lawson@gmail.com>
 Date:   Fri May 20 15:01:15 2016 -0700

     (#5128) - split PouchDB into a monorepo with separate packages

@alxndrsn
Copy link
Member Author

alxndrsn commented Oct 3, 2017

To generate a coverage report locally:

  1. SERVER="pouchdb-server" TRAVIS_REPO_SLUG="pouchdb/pouchdb" PLUGINS=pouchdb-find COVERAGE=1 npm run report-coverage

This will try (and fail) to upload the generated report to coveralls, returning a non-zero status code on the console. Ignore this, and then:

  1. open ./coverage/lcov-report/index.html

With thanks to @willholley.

@stale
Copy link

stale bot commented Dec 2, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@alxndrsn
Copy link
Member Author

alxndrsn commented Dec 3, 2017

@Stale please don't close

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

No branches or pull requests

2 participants