conformance: check response status before checking location#420
Merged
jdolitsky merged 1 commit intoopencontainers:mainfrom Jun 21, 2023
Merged
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 <rogpeppe@gmail.com>
ebe2142 to
a971875
Compare
sudo-bmitch
approved these changes
May 27, 2023
rchincha
reviewed
Jun 2, 2023
| @@ -233,8 +233,8 @@ var test02Push = func() { | |||
| resp, err := client.Do(req) | |||
| Expect(err).To(BeNil()) | |||
| location := resp.Header().Get("Location") | |||
Contributor
There was a problem hiding this comment.
nit: why not colocate this line with the Expect line itself? interrupts readability.
Contributor
Author
There was a problem hiding this comment.
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).
jonjohnsonjr
approved these changes
Jun 19, 2023
sudo-bmitch
pushed a commit
to sudo-bmitch/distribution-spec
that referenced
this pull request
Aug 18, 2023
…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 <rogpeppe@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.