Skip to content

Commit f63e5dd

Browse files
author
aaguirre
committed
include e2e tests in oc-mirror payload
1 parent 14f93cb commit f63e5dd

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

Dockerfile.tests-extension

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN cd tests-extension && \
1414
-pkg testdata -o testdata/bindata.go -prefix "testdata" testdata/... && \
1515
cd ../.. && \
1616
gofmt -s -w test/e2e/testdata/bindata.go && \
17-
CGO_ENABLED=0 GO_COMPLIANCE_POLICY="exempt_all" GOTOOLCHAIN=auto go build -mod=vendor -o bin/oc-mirror-tests-ext ./cmd && \
17+
CGO_ENABLED=0 GO_COMPLIANCE_POLICY="exempt_all" GOTOOLCHAIN=auto go build -mod=vendor -p 2 -o bin/oc-mirror-tests-ext ./cmd && \
1818
cd bin && \
1919
tar -czvf oc-mirror-test-extension.tar.gz oc-mirror-tests-ext && \
2020
rm -f oc-mirror-tests-ext

images/cli/Dockerfile.ci

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,28 @@ WORKDIR /go/src/github.com/openshift/oc-mirror
99
COPY . .
1010
RUN make build
1111

12+
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS test-extension-builder
13+
WORKDIR /go/src/github.com/openshift/oc-mirror
14+
COPY . .
15+
RUN cd tests-extension && \
16+
GOTOOLCHAIN=auto go mod vendor && \
17+
GOPATH=$(go env GOPATH) && \
18+
GOFLAGS= go install github.com/go-bindata/go-bindata/v3/go-bindata@latest && \
19+
cd test/e2e && \
20+
$GOPATH/bin/go-bindata -nocompress \
21+
-pkg testdata -o testdata/bindata.go -prefix "testdata" testdata/... && \
22+
cd ../.. && \
23+
gofmt -s -w test/e2e/testdata/bindata.go && \
24+
CGO_ENABLED=0 GO_COMPLIANCE_POLICY="exempt_all" GOTOOLCHAIN=auto go build -mod=vendor -p 2 -o bin/oc-mirror-tests-ext ./cmd && \
25+
cd bin && \
26+
tar -czvf oc-mirror-test-extension.tar.gz oc-mirror-tests-ext && \
27+
rm -f oc-mirror-tests-ext
28+
1229
FROM registry.ci.openshift.org/ocp/4.22:base-rhel9
1330
COPY --from=builder_rhel8 /go/src/github.com/openshift/oc-mirror/bin/oc-mirror /usr/bin/oc-mirror.rhel8
1431
COPY --from=builder_rhel9 /go/src/github.com/openshift/oc-mirror/bin/oc-mirror /usr/bin/oc-mirror
1532
COPY --from=builder_rhel9 /go/src/github.com/openshift/oc-mirror/bin/oc-mirror /usr/bin/oc-mirror.rhel9
33+
COPY --from=test-extension-builder /go/src/github.com/openshift/oc-mirror/tests-extension/bin/oc-mirror-test-extension.tar.gz /usr/bin/oc-mirror-test-extension.tar.gz
1634

1735
LABEL io.k8s.display-name="oc-mirror" \
1836
io.k8s.description="OpenShift is a platform for developing, building, and deploying containerized applications." \

0 commit comments

Comments
 (0)