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

Enhance test coverage for call_derivation(), derive_vars_merged(), get_not_mapped() #2580

Open
3 tasks
manciniedoardo opened this issue Nov 27, 2024 · 2 comments
Assignees
Labels

Comments

@manciniedoardo
Copy link
Collaborator

Background Information

It would be great to get {admiral}'s test coverage to 100%. However, this should not come at the expense of development time/effort from {admiral} core developers. As such, I have made a set of issues tagged "Unit Tests" (such as this one for call_derivation(), derive_vars_merged() and get_not_mapped()) where users who wish to dip their feet into the {admiral} ecosystem can:

  • Learn a bit about unit testing for R packages
  • Make a meaningful contribution to {admiral}

by adding or modifying unit tests to account for lines not previously covered.

Important note: Given the above, this issue is for newcomers to {admiral} or users who wish to contribute to the package, and should not be taken on by core {admiral} developers.

Definition of Done

  • Unit test(s) added/modified to test the lines in red in call_derivation():
    image

  • Unit test(s) added/modified to test the lines in red in derive_vars_merged():
    image

  • Unit test(s) added/modified to test the lines in red in get_not_mapped():
    image

@bms63
Copy link
Collaborator

bms63 commented Nov 27, 2024

@manciniedoardo We might want to break these up into individual issues?

I think some of this environment handling tests are not easy - perhaps that is why there is no coverage of them

@jimrothstein
Copy link
Collaborator

jimrothstein commented Dec 20, 2024

line # 783: get_not_mapped() - Goal: get this function to run (code coverage).

(Trying to find another way to explain this ....)

Work backwards:

line # 761 must run
line # 749 df temp_not_mapped must have rows
line # 746 unless tmp_lookup_flag is NA; runs filter(F) returns no rows.
line # 729 tmp_lookup_flag is set and NEVER NULL or NA

In debug, I reset tmp_lookup_flag ... to get call to get_not_mapped()


image

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

No branches or pull requests

3 participants