This patch specifies a few guidelines that our API tests should follow.
The motivations for this are twofold:
- API tests have unexpected pitfalls that especially new contributors run into when writing tests. To prevent the frustration of letting people figure those pitfalls out by trial-and-error, let's just document them briefly in one place.
- It prevents some arguing about what is the right way to write tests. I really like to have fast and reliable API test suite, but I also don't want to be the bogeyman that has to insist in every review that the test should be rewritten to not launch a process for no good reason. It's much easier to just point to a policy document.
I omitted some guidelines that I think could be controversial (e.g., the whole "should assert message describe failure or success").
While I agree with this, it also feels unhelpful because it does not give any examples nor explain the alternatives.
I can see the problem with pointing at specific tests which may disappear or change. I can also see the problem with attempting to enumerate all the possibilities below this as well.
Maybe we need a set of example tests as well?
Most of the rest of advice stands alone pretty well though.