-
Notifications
You must be signed in to change notification settings - Fork 128
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
filter: Update working directory of cram tests #1133
Conversation
Codecov ReportBase: 68.08% // Head: 68.11% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1133 +/- ##
==========================================
+ Coverage 68.08% 68.11% +0.02%
==========================================
Files 62 62
Lines 6690 6690
Branches 1641 1641
==========================================
+ Hits 4555 4557 +2
+ Misses 1829 1827 -2
Partials 306 306
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
d2ea4f0
to
4145e1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for this direction!
tests/functional/filter/cram/filter-metadata-sequence-strains-mismatch.t
Outdated
Show resolved
Hide resolved
$TMP is the test runner's temp directory, which is shared across all individual tests¹. This means files must be removed before running the next test to ensure a clean slate. On the other hand, the initial working directory of each test² is a directory within $TMP which is truly temporary per test file. I updated all tests to use this initial working directory as a temporary directory. A summary of the changes: 1. Change the working directory from "$TESTDIR/../../" (tests/functional/) to the default initial working directory. 2. Update references to files in tests/functional/filter/data, since those had relied on the parent folder as the working directory. 3. Remove directory changes in the "setup" section, simplifying that to one command creating the AUGUR alias relative to $TESTDIR. 4. Remove rm commands used to clean up output files, since the working directory is a per-test temporary directory. 5. filter-metadata-sequence-strains-mismatch.t: Update the diff check to a direct check of file contents, since the resolved $TESTDIR must be matched as a pattern. ¹ https://github.com/brodie/cram/blob/61212ab78a88ce4a18eee4e26c89bfe086b28e78/cram/_main.py#L185 ² https://github.com/brodie/cram/blob/61212ab78a88ce4a18eee4e26c89bfe086b28e78/cram/_run.py#L67-L70
The first point describes a new way to organize test files (started by 5ce415f, used in tests/functional/curate/cram and tests/functional/filter/cram) The second point summarizes the previous commit.
7f738e5
to
5d2e370
Compare
Description of proposed changes
$TMP
is the test runner's temp directory, which is shared across all individual tests. This means files must be removed before running the next test to ensure a clean slate.On the other hand, the initial working directory of each test is a directory within
$TMP
which is truly temporary per test file.I updated all tests to use this initial working directory as a temporary directory. A summary of the changes:
$TESTDIR/../../
(tests/functional/
) to the default initial working directory.tests/functional/filter/data
, since those had relied on the parent folder as the working directory.AUGUR
alias relative to$TESTDIR
.filter-metadata-sequence-strains-mismatch.t
: Update the diff check to a direct check of file contents, since the resolved$TESTDIR
must be matched by regex.Note that if this approach is applied to other cram tests, issues/workarounds such as #863 and #1077 can be avoided.
Related issue(s)
N/A
Testing
What steps should be taken to test the changes you've proposed?
If you added or changed behavior in the codebase, did you update the tests, or do you need help with this?
Checklist
Add a message in CHANGES.md summarizing the changes in this PR that are end user focused. Keep headers and formatting consistent with the rest of the file.N/A, dev change