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

R package unit test coverage is not 100% #33

Open
jameslamb opened this issue Sep 7, 2017 · 4 comments
Open

R package unit test coverage is not 100% #33

jameslamb opened this issue Sep 7, 2017 · 4 comments

Comments

@jameslamb
Copy link
Collaborator

Currently, unit tests cover only 59% of the lines of code in this project. Ideally, we would like every line in the project to be covered by tests.

@jameslamb
Copy link
Collaborator Author

happy to report we have near-100% coverage now as of #66! Still leaving this open...we would love help covering the last few tough-to-hit cases

@jameslamb
Copy link
Collaborator Author

coverage as of #72

image

^ note that those get_fields lines are actually covered...there are two scrolling strategies (one for new, one for legacy), and only one of the two gets covered in any single set of tests (on a single ES version). They're both covered because our CI stuff tests over many versions

@jameslamb
Copy link
Collaborator Author

so our coverage is above 97%! Those last few lines would be real real hard to cover, but someone is welcome to take this up if they really want

@jameslamb jameslamb reopened this Jun 19, 2018
@jameslamb jameslamb added the R label Sep 24, 2018
@jameslamb jameslamb changed the title Unit test coverage is not 100% R package unit test coverage is not 100% Oct 24, 2019
@jameslamb
Copy link
Collaborator Author

If you want to contribute on this, here's how you can check the test coverage:

  1. Spin up Elasticsearch locally and seed it with data. This requires that you have docker running
./setup_local.sh 6.2
  1. Install the package and run the R tests
make install_r
make coverage_r

You should see something like this in the terminal

image

and a file coverage.html should open in your default web browser. That file shows detailed information on which files have untested code and which lines specifically are untested.

  1. Add tests in R-package/tests/testthat and repeat step 2

  2. When you're done, be sure to clean up your local environment

./cleanup_local.sh

PRs that add any test coverage are welcomed! You do not have to get to 100% in one shot.

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

No branches or pull requests

1 participant