test: check for errors in acme tests before passing the body
What does this MR do?
I got a SIGSEV while working on another MR and noticed we're passing rsp.Body without checking rsp for nullness.
This MR move rsp.Body.Close() after require.NoError to avoid the SIGSEV and correctly report the error using the assertion.
testhelper is also removed in this situation so that the body is closed as soon as possible and can be reused in the next iteration.
TODO
-
I added the Changelogtrailer (e.g.Changelog: added) to the commits that need to be included in the changelog -
I added unit tests or they are not required -
I added acceptance tests or they are not required -
I added documentation (or it's not required) -
I followed code review guidelines -
I followed Go Style guidelines
Edited by feistel