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

refactoring for testablity #7946

Merged
merged 2 commits into from
Jul 18, 2022
Merged

refactoring for testablity #7946

merged 2 commits into from
Jul 18, 2022

Conversation

kcibul
Copy link
Contributor

@kcibul kcibul commented Jul 15, 2022

Code refactoring for better testability as part of the spanning deletions work that is being shelved.

Refactoring Changes
One of the challenges with this PR was testing as the work is really done in the lower-level methods and it would be nice to have this as a unit test rather than an integration/end-to-end test. This motivated the following changes:

  • don't write to VCF directly, instead have take a Consumer to emit VariantContexts. This lets us provide a different consumer in unit tests to collect our result.
  • we previously had a chain of calls createVariantsFromSortedRanges -> processSampleRecordsForLocation -> finalizeCurrentVariant that returned void and as a side effect wrote to VCF. These deeper methods now return a VariantContext and the writing (via consumer) is done higher up in the call stack
  • made some private methods package-private so we could call them from tests

@codecov
Copy link

codecov bot commented Jul 15, 2022

Codecov Report

❗ No coverage uploaded for pull request base (ah_var_store@8781b56). Click here to learn what that means.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             ah_var_store     #7946   +/-   ##
================================================
  Coverage                ?   86.241%           
  Complexity              ?     35201           
================================================
  Files                   ?      2173           
  Lines                   ?    165016           
  Branches                ?     17792           
================================================
  Hits                    ?    142311           
  Misses                  ?     16378           
  Partials                ?      6327           

Copy link
Collaborator

@gbggrant gbggrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@kcibul kcibul merged commit 210a6ae into ah_var_store Jul 18, 2022
@kcibul kcibul deleted the kc_test_refactor branch July 18, 2022 00:35
This was referenced Mar 17, 2023
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

Successfully merging this pull request may close these issues.

2 participants