Automate conformance testing on PR using zot#401
Automate conformance testing on PR using zot#401jdolitsky merged 9 commits intoopencontainers:mainfrom
Conversation
bf3f0e0 to
27ee85d
Compare
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
27ee85d to
bea9b6f
Compare
|
cc @rchincha |
|
@jdolitsky Taking a look at these failures. |
|
Hello, I've been debugging this, here is the summary:
This one is pretty straightforward, it happens because our GetBlobUpload doesn't return "bytes=" part in Range header.
This one assumes that the registry will do a cross-repo mount. In this case, zot will not mount the blob because it has dedupe disabled. (zot doesn't support cross-repo mounts but it uses its dedupe cache to work around it) Looking at the test https://github.com/opencontainers/distribution-spec/blob/main/conformance/02_push_test.go#L276 From my understanding the test should be fixed(more below), but I may be wrong.
This one is using the http response from test 2) https://github.com/opencontainers/distribution-spec/blob/main/conformance/02_push_test.go#L297 But in this case, because 2) failed, I think that lastResponse doesn't get updated, and it checks a previous response. As a side effect, both 2) and 3) passes if we use dedupe true(because then cross mount will work), just a a side note. From my point of view this would be a fix, moving the last assertion to the next test: Basically the test SHOULD: according to this: https://github.com/opencontainers/distribution-spec/blob/main/spec.md?plain=1#L437 Currently, in the case of 202 response, the test expects both a sessionID Location and a blob Location which doesn't make sense: |
|
@peusebiu pls test with https://github.com/project-zot/zot/blob/main/examples/config-conformance.json. Your observations still valid? |
yes, I used that without any modification |
|
|
Hello, In the cross mount blob test you expect one of two responses: so far so good, this meets the dist-spec standard. But then, on the next line, you expect a blob to be mounted: This line ^ should be run only if the blob was mounted, if registry couldn't mount the blob, or doesn't support cross-mounts, then it should start an upload session and return its location (according to dist-spec). Move the above line here: https://github.com/opencontainers/distribution-spec/blob/main/conformance/02_push_test.go#L288 to correctly run it only if the blob was mount. As it is now, this test can not pass on any dist-spec implementation. |
…to automate-conformance
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
conformance/02_push_test.go
Outdated
| Expect(resp.Header().Get("Range")).To(SatisfyAny( | ||
| Equal(testBlobBChunk1Range), // Allow missing "bytes=" prefix | ||
| Equal(fmt.Sprintf("bytes=%s", testBlobBChunk1Range)), | ||
| )) |
There was a problem hiding this comment.
added this change to allow for missing "bytes=" prefix
There was a problem hiding this comment.
chatting with @rchincha - looks like this is required: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range
working on zot version with this fix
There was a problem hiding this comment.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range
<unit> doesn't look optional, so this appears to be a zot bug and addressed in project-zot/zot#1341
There was a problem hiding this comment.
To follow the robustness principle, I believe we need to be strict in what registries output here, only allowing the output without bytes=. Registries and clients can be liberal in what they accept from each other, but for conformance, their output should follow the distribution-spec.
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
d5ff85a to
18fdcbd
Compare
|
After opening up all the Test Reports > Blob Upload Chunked here: https://conformance.opencontainers.org/ it looks like every registry provides the |
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
|
It looks like the spec actually covers this:
|
It would be great if we didn't flout the HTTP RFCs like this -- ideally we fix this, but I'm ok if we allow both for legacy reasons. I'm not sure how clients would handle it :/ |
Yes, I'm not sure how clients would handle it either.. do not know where/how to start testing that. Do we want to switch to the following which would allow both? Expect(resp.Header().Get("Range")).To(SatisfyAny(
Equal(testBlobBChunk1Range), // Allow missing "bytes=" prefix
Equal(fmt.Sprintf("bytes=%s", testBlobBChunk1Range)),
))Does this risk a registry claiming conformance, providing the prefix and some client breaking somewhere? |
Would do only one, even if doesn't follow the rfc :( lgtm |
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
|
As discussed on the call, switched to allow either format for now |
|
If popular clients don't break (most likely they are not using chunked uploads at all), considering to make the change in zot to do the right thing per HTTP rfc. We have had non-cloud embedded clients requiring the HTTP rfc behavior. Your "SatisfyAny()" clause should still work. |
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
Looks like its not quite passing yet, so made it still pass the test if conformance fails