-
Notifications
You must be signed in to change notification settings - Fork 206
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
conformance: check response status before checking location #420
conformance: check response status before checking location #420
Conversation
I noticed that when these tests are running against a server that returns the wrong status code (an error, for example), the failure that we see doesn't mention the status code, but only that the returned location is empty. This change checks the status code first, as if that's wrong, the location is very unlikely to be relevant. Signed-off-by: Roger Peppe <[email protected]>
ebe2142
to
a971875
Compare
@@ -233,8 +233,8 @@ var test02Push = func() { | |||
resp, err := client.Do(req) | |||
Expect(err).To(BeNil()) | |||
location := resp.Header().Get("Location") |
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.
nit: why not colocate this line with the Expect line itself? interrupts readability.
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.
Because this is the way it's done in every other test and this PR is about changing exactly one property of a couple of tests, not changing things which are technically fine the way they are now and might have been done for good reason.
If we were to change other aspects of these tests, there are way more important things to do, in my view (see #416 for an example).
…ainers#420) I noticed that when these tests are running against a server that returns the wrong status code (an error, for example), the failure that we see doesn't mention the status code, but only that the returned location is empty. This change checks the status code first, as if that's wrong, the location is very unlikely to be relevant. Signed-off-by: Roger Peppe <[email protected]>
I noticed that when these tests are running against a server that returns the wrong status code (an error, for example), the failure that we see doesn't mention the status code, but only that the returned location is empty.
This change checks the status code first, as if that's wrong, the location is very unlikely to be relevant.