-
Notifications
You must be signed in to change notification settings - Fork 213
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: fix inappropriate test HTTP method #332
Conversation
Change HTTP method from PUT to GET to allow a pull only registry to be tested. PUT requests should not be used during pull testing. Signed-off-by: Graham Miln <[email protected]>
Doesn't line 195 cause this to be skipped when doing pull only testing? |
Line 195, The affected test intends to check the error handling behaviour for a well formed but invalid request. The test currently issues a |
It is possible we imply need to expand allow HTTP status codes for this endpoint. @grahammiln - could you tell us the HTTP status code returned for this endpoint? It looks like 404 or 400 will be ok, and if 400 the error should be properly formatted JSON: Expect(resp.StatusCode()).To(SatisfyAny(
Equal(http.StatusBadRequest),
Equal(http.StatusNotFound)))
if resp.StatusCode() == http.StatusBadRequest {
errorResponses, err := resp.Errors()
Expect(err).To(BeNil())
Expect(errorResponses).ToNot(BeEmpty())
Expect(errorCodes).To(ContainElement(errorResponses[0].Code))
}
``` |
Package Origin follows the specification and returns a curl -v -X PUT -H "Content-Type: application/vnd.oci.image.manifest.v1+json" "https://pkg.miln.eu/v2/packageorigin/oci-distribution-conformance/manifests/sha256:totallywrong" Returning the body: {
"errors": [
{
"code": "UNSUPPORTED",
"message": "Registry is read-only."
}
]
} Expanding the test's accepted
This would dilute the test and is better avoided. The proposed fix is minimal and restores the intent of the test. I agree that a second error handling test would be useful, but that should not stop this test's bug being fixed first. Does this help clarify the problem? |
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.
nod.. let's fix the test checking for 405 on the pull only.. and fix this push invalid test to validate we are actually on a push enabled registry..
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.
Actualización
Change HTTP method from PUT to GET to allow a pull only registry to be tested. PUT requests should not be used during pull testing. Signed-off-by: Graham Miln <[email protected]> Co-authored-by: Josh Dolitsky <[email protected]>
Change HTTP method from PUT to GET to allow a pull only registry to be tested. PUT requests should not be used during pull testing.
Signed-off-by: Graham Miln [email protected]