Skip to content

Commit

Permalink
Merge branch 'main' of github.com:opencontainers/distribution-spec in…
Browse files Browse the repository at this point in the history
…to pr-conformance-index-subject
  • Loading branch information
jdolitsky committed Jul 24, 2023
2 parents 748a953 + 9b5b19b commit 9448bf5
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 258 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ifeq "$(strip $(PANDOC))" ''
endif
endif

GOLANGCILINT_CONTAINER ?= ghcr.io/opencontainers/golangci-lint:v1.42.1@sha256:9a2c9bc1c62d50b4a326d2982caa60c995d42184a16ed9d9378b38e540da0c8f
GOLANGCILINT_CONTAINER ?= ghcr.io/opencontainers/golangci-lint:v1.52.1@sha256:d3d3d56f9706ebe843c1b06686c385877ba65b33f39507cdbeb22f482adce65a
ifeq "$(strip $(GOLANGCILINT))" ''
ifneq "$(strip $(DOCKER))" ''
GOLANGCILINT = $(DOCKER) run \
Expand Down Expand Up @@ -91,7 +91,7 @@ conformance-test:

conformance-binary: $(OUTPUT_DIRNAME)/conformance.test

TEST_REGISTRY_CONTAINER ?= ghcr.io/project-zot/zot-minimal-linux-amd64:v2.0.0-rc5@sha256:740c4a4d99bf720761fd6407a227177cfeb3b1c0d4a230e16ceea960dc91dd11
TEST_REGISTRY_CONTAINER ?= ghcr.io/project-zot/zot-minimal-linux-amd64:v2.0.0-rc6@sha256:bf95a94849cd9c6f596fb10e5a2d03b74267e7886d1ba0b3dab33337d9e46e5c
registry-ci:
docker rm -f oci-conformance && \
echo '{"distSpecVersion":"1.1.0-dev","storage":{"rootDirectory":"/tmp/zot","gc":false,"dedupe":false},"http":{"address":"0.0.0.0","port":"5000"},"log":{"level":"debug"}}' > $(shell pwd)/$(OUTPUT_DIRNAME)/zot-config.json
Expand Down
16 changes: 12 additions & 4 deletions conformance/00_conformance_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package conformance

import (
"log"
"testing"

g "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
g "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand All @@ -17,6 +17,14 @@ func TestConformance(t *testing.T) {
})

RegisterFailHandler(g.Fail)
reporters := []g.Reporter{newHTMLReporter(reportHTMLFilename), reporters.NewJUnitReporter(reportJUnitFilename)}
g.RunSpecsWithDefaultAndCustomReporters(t, suiteDescription, reporters)
suiteConfig, reporterConfig := g.GinkgoConfiguration()
reporterConfig.JUnitReport = reportJUnitFilename
hr := newHTMLReporter(reportHTMLFilename)
g.ReportAfterEach(hr.afterReport)
g.ReportAfterSuite("html custom reporter", func(r g.Report) {
if err := hr.endSuite(r); err != nil {
log.Printf("\nWARNING: cannot write HTML summary report: %v", err)
}
})
g.RunSpecs(t, "conformance tests", suiteConfig, reporterConfig)
}
2 changes: 1 addition & 1 deletion conformance/01_pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/bloodorangeio/reggie"
g "github.com/onsi/ginkgo"
g "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
4 changes: 3 additions & 1 deletion conformance/02_push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"

"github.com/bloodorangeio/reggie"
g "github.com/onsi/ginkgo"
g "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down Expand Up @@ -41,6 +41,7 @@ var test02Push = func() {

g.Specify("PUT request to session URL with digest should yield 201 response", func() {
SkipIfDisabled(push)
Expect(lastResponse).ToNot(BeNil())
req := client.NewRequest(reggie.PUT, lastResponse.GetRelativeLocation()).
SetQueryParam("digest", testBlobADigest).
SetHeader("Content-Type", "application/octet-stream").
Expand Down Expand Up @@ -83,6 +84,7 @@ var test02Push = func() {

g.Specify("GET request to blob URL from prior request should yield 200 or 404 based on response code", func() {
SkipIfDisabled(push)
Expect(lastResponse).ToNot(BeNil())
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configs[1].Digest))
resp, err := client.Do(req)
Expect(err).To(BeNil())
Expand Down
4 changes: 2 additions & 2 deletions conformance/03_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/bloodorangeio/reggie"
g "github.com/onsi/ginkgo"
g "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
godigest "github.com/opencontainers/go-digest"
)
Expand Down Expand Up @@ -335,7 +335,7 @@ var test03ContentDiscovery = func() {
// also check resp header "OCI-Filters-Applied: artifactType" denoting that an artifactType filter was applied
if resp.Header().Get("OCI-Filters-Applied") != "" {
Expect(len(index.Manifests)).To(Equal(2))
Expect(resp.Header().Get("OCI-Filters-Applied")).To(Equal(testRefArtifactTypeA))
Expect(resp.Header().Get("OCI-Filters-Applied")).To(Equal(artifactTypeFilter))
} else {
Expect(len(index.Manifests)).To(Equal(5))
Warn("filtering by artifact-type is not implemented")
Expand Down
2 changes: 1 addition & 1 deletion conformance/04_management_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"

"github.com/bloodorangeio/reggie"
g "github.com/onsi/ginkgo"
g "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
22 changes: 12 additions & 10 deletions conformance/go.mod
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
module github.com/opencontainers/distribution-spec/conformance

go 1.17
go 1.20

require (
github.com/bloodorangeio/reggie v0.6.1
github.com/google/uuid v1.3.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.16.0
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.8
github.com/opencontainers/go-digest v1.0.0
)

require (
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-resty/resty/v2 v2.7.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/tools v0.10.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 9448bf5

Please sign in to comment.