-
Notifications
You must be signed in to change notification settings - Fork 9
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
Should unit tests be stateless? #66
Comments
I think you should remove state before running a test, not after. In On Fri, Oct 2, 2015 at 7:23 AM, aaaaalbert [email protected] wrote:
|
Sure, makes sense. Any feelings on whether cleaning up is a MUST, SHOULD, or MAY in the sense of RFC 2119? 😉 (Currently, the decision is left to the implementor.) |
In the case of success I think it would be a SHOULD. However, there are also pre and post scripts for certain test modules The tests are here to make our lives easier. If being very rigid about our (We should already have this for some of the resource tests that may crash On Fri, Oct 2, 2015 at 12:17 PM, aaaaalbert [email protected]
|
We don't have a policy for whether unit tests must "clean up after themselves" or not, i.e. may leave traces of the state / fact of their exceution or not. Some tests clean up, some don't despite causing significant artifacts that changes the behavior of later re-runs through the same test.
Pros of requiring cleanup
Cons of requiring cleanup
A middle ground could be to somehow mark tests that require a re-build after they have run. Then at least it's clear that problems may arise.
Reaching out to @JustinCappos, @vladimir-v-diaz, @awwad in particular --- What do you think?
The text was updated successfully, but these errors were encountered: