-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixing known test issues and small test refactoring. #88
Conversation
Note for myself
|
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.
Great work! All good. Just a few minor comments/questions.
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.
LGTM
Summary
Our tests don't consistently pass, which can be misleading for new contributors who find their new PR may lead to a failed build.
This was caused by 2 main issues, not completely tearing down the tests (e.g. cleanup) and a runtime error thrown by NaMaster that bubbles up the stack into our code.
With these changes I verified all tests pass (individually or all together) and all temporary files get cleaned up
NaMaster issue
write_to
on namaster workspace, covariances and this writes to a file. This can randomly throw a runtime exception "Unable to write to file"pytest-retry
which allows us to re-run tests that fail, I allow the tests affected by this bug to re-try 5 times. If we succeed once, we know it was the NaMaster issue and we pass the test.Test changes
setup_module()
andteardown_module()
. These run once at the beginning of each test file. This allows us to have more controlled reading/writing of files without constantly needing to check if files exist or deleting files that should still exist.tests/tmp/
directory. Before they were writing to separate directories.tmp/
subdirectory. This works but because of the code structure we would need 1 configuration file per test.Code Changes
clobber
argument toget_covariance_block
to allow a user to recalculate the covariance if they want to. Currently the only way to do that is manual or re-instantiate the class. This simplifies the test as well as giving more functionality to the user.Build changes
--no-bin
(see comments), this was causing mpich tests to fail. I updated the build script to use the new option--no-cache-dir