-
Notifications
You must be signed in to change notification settings - Fork 150
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
Cross platform test suite compatibility #127
Cross platform test suite compatibility #127
Conversation
…test adds it in linux/osx)
Codecov Report
@@ Coverage Diff @@
## master #127 +/- ##
=========================================
Coverage ? 42.83%
=========================================
Files ? 88
Lines ? 11484
Branches ? 0
=========================================
Hits ? 4919
Misses ? 6565
Partials ? 0
Continue to review full report at Codecov.
|
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.
This is amazing.
This PR gets the minimal set of AllenSDK tests to pass on any platform (Windows, OSX, linux) under python 2.7 and 3.6. The minimal set of tests is defined as the following environment variables set:
TEST_NWB_FILES=skip
TEST_OBSERVATORY_EXPERIMENT_PLOTS_DATA=skip
TEST_API_ENDPOINT=http://api.brain-map.org
TEST_COMPLETE=false
In the process of doing this the following SDK bugs were discovered and fixed:
In order to run on Windows, the --boxed flag cannot be used because it is just an alias for --forked which explicitly uses os.fork() to run tests in submodules (as an aside, --boxed is deprecated and unmaintained). This lead to the discovery of a bunch of monkeypatching and mock assignments that were performed improperly and leaked scope across test modules. The majority of the changes in this PR are fixing those mocks. Some patterns that were used and should be avoided because they break downstream tests when not run in isolated:
The bad patch:
The import/reload patch:
All instances of the above patterns that were causing tests to fail have been removed and replaced with properly scoped patches. This doesn't mean that all instances of the patterns have been found (since it's possible a bad patch was made on a function that isn't used again in a downstream test and I didn't systematically search through every test).
Other side effects: