Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Improve our test isolation #4798
Conversation
jameinel
added some commits
Mar 17, 2016
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
jameinel
added some commits
Mar 21, 2016
|
$$merge$$ looks like someone landed a new test suite that didn't call BaseSuite. |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
added a commit
that referenced
this pull request
Mar 21, 2016
jujubot
merged commit 3e3f19d
into
juju:master
Mar 21, 2016
jameinel
deleted the
jameinel:unsafe-cleanups
branch
Dec 13, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jameinel commentedMar 19, 2016
We make heavy use of PatchValue in our test suite. But the existing code actually had several failure modes.
I submitted a patch to github.com/juju/testing that changed PatchValue to be safer, and refuse to patch when it looks like we weren't doing what you want. This change against Juju Core brings in the updated testing package, and fixes all of the places that failed because they weren't actually setting themselves up correctly.
The safety checks also mean that you have to call CleanupSuite.SetUpTest() before you call PatchValue for that test. Which required moving some PatchValues around. Sometimes moving things from SetUpTest to SetUpSuite if they needed to be patched before Base.SetUpTest() is called. (we have a few places that need to inject Clock or something like that, into the service that is started in SetUpTest.)
Everything passes on my Trusty box, but I can't be sure it will pass on all platforms.
(Review request: http://reviews.vapour.ws/r/4240/)