Skip to content
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

ci: Use pre-built e2e/integration test binaries #3876

Merged
merged 5 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ GOARCH ?= $(shell go env GOARCH)
HOST_BUILD_DIR=$(BUILD_DIR)/$(GOOS)-$(GOARCH)
GOPATH ?= $(shell go env GOPATH)
ORG := github.com/crc-org
MODULEPATH ?= $(ORG)/crc/v2
MODULEPATH = $(ORG)/crc/v2
PACKAGE_DIR := packaging/$(GOOS)

SOURCES := $(shell git ls-files *.go ":^vendor")
Expand Down Expand Up @@ -235,9 +235,6 @@ endif
ifndef CRC_BINARY
CRC_BINARY = --crc-binary=$(GOPATH)/bin
endif
ifndef VERSION_TO_TEST
VERSION_TO_TEST = --crc-version=$(CRC_VERSION)+$(COMMIT_SHA)
endif
e2e:
@go test --timeout=180m $(MODULEPATH)/test/e2e -tags "$(BUILDTAGS)" --ldflags="$(VERSION_VARIABLES)" -v $(PULL_SECRET_FILE) $(BUNDLE_LOCATION) $(CRC_BINARY) $(GODOG_OPTS) $(CLEANUP_HOME) $(VERSION_TO_TEST) $(INSTALLER_PATH) $(USER_PASSWORD)

Expand Down
10 changes: 5 additions & 5 deletions images/openshift-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ WORKDIR /go/src/github.com/crc-org/crc
COPY . .
RUN make release

FROM quay.io/centos/centos:stream8
FROM registry.access.redhat.com/ubi9/ubi
COPY --from=builder /go/src/github.com/crc-org/crc /opt/crc
COPY --from=builder /go/src/github.com/crc-org/crc/out/linux-amd64/crc /bin/crc
COPY --from=builder /go/src/github.com/crc-org/crc/out/linux-amd64/e2e.test /bin/e2e.test
COPY --from=builder /go/src/github.com/crc-org/crc/out/linux-amd64/e2e.test /bin/integration.test
COPY --from=builder /go/src/github.com/crc-org/crc/out/windows-amd64/crc.exe /opt/crc.exe
COPY --from=builder /go/src/github.com/crc-org/crc/out/windows-amd64/e2e.test.exe /opt/e2e.test.exe
COPY --from=builder /go/src/github.com/crc-org/crc/out/windows-amd64/e2e.test.exe /opt/integration.test.exe
COPY --from=builder /go/src/github.com/crc-org/crc/images/openshift-ci/mock-nss.sh /bin/mock-nss.sh
COPY --from=builder /go/src/github.com/crc-org/crc/images/openshift-ci/google-cloud-sdk.repo /etc/yum.repos.d/google-cloud-sdk.repo
COPY --from=builder /go/src/github.com/crc-org/crc/images/openshift-ci/azure-cli.repo /etc/yum.repos.d/azure-cli.repo

RUN yum update -y && \
yum install --setopt=tsflags=nodocs -y \
genisoimage \
gettext \
google-cloud-sdk \
libvirt-client \
libvirt-libs \
nss_wrapper \
unzip \
sshpass \
Expand Down
7 changes: 6 additions & 1 deletion test/e2e/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/crc-org/crc/v2/pkg/crc/constants"
"github.com/crc-org/crc/v2/pkg/crc/preset"
"github.com/crc-org/crc/v2/pkg/crc/version"
"github.com/crc-org/crc/v2/test/extended/crc/cmd"
crcCmd "github.com/crc-org/crc/v2/test/extended/crc/cmd"
"github.com/crc-org/crc/v2/test/extended/util"
Expand All @@ -34,6 +35,10 @@ var (
GodogTags string
)

func defaultCRCVersion() string {
return fmt.Sprintf("%s+%s", version.GetCRCVersion(), version.GetCommitSha())
}

func ParseFlags() {

pflag.StringVar(&util.TestDir, "test-dir", "out", "Path to the directory in which to execute the tests")
Expand All @@ -43,7 +48,7 @@ func ParseFlags() {
pflag.StringVar(&pullSecretFile, "pull-secret-file", "/path/to/pull-secret", "Path to the file containing pull secret")
pflag.StringVar(&CRCExecutable, "crc-binary", "", "Path to the CRC executable to be tested")
pflag.BoolVar(&cleanupHome, "cleanup-home", false, "Try to remove crc home folder before starting the suite") // TODO: default=true
pflag.StringVar(&CRCVersion, "crc-version", "", "Version of CRC to be tested")
pflag.StringVar(&CRCVersion, "crc-version", defaultCRCVersion(), "Version of CRC to be tested")
}

func InitializeTestSuite(tctx *godog.TestSuiteContext) {
Expand Down