Skip to content

Commit

Permalink
Use correct Go version in E2E test JUnit files
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-krishna committed Aug 30, 2024
1 parent e195e72 commit 111d8a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ ARTIFACTS_BUCKET?=my-s3-bucket
GIT_VERSION?=$(shell git describe --tag)
GIT_TAG?=$(shell git tag -l "v*.*.*" --sort -v:refname | head -1)
GOLANG_VERSION?="1.21"
GO_VERSION ?= $(shell source ./scripts/common.sh && build::common::get_go_path $(GOLANG_VERSION))
GO ?= $(GO_VERSION)/go
GO_PATH?= $(shell source ./scripts/common.sh && build::common::get_go_path $(GOLANG_VERSION))
GO ?= $(GO_PATH)/go
GO_TEST ?= $(GO) test
# A regular expression defining what packages to exclude from the unit-test recipe.
UNIT_TEST_PACKAGE_EXCLUSION_REGEX ?=mocks$
Expand Down Expand Up @@ -545,7 +545,7 @@ packages-e2e-test: build-all-test-binaries ## Run Curated Packages tests
./bin/e2e.test -test.v -test.run $(PACKAGES_E2E_TESTS)

.PHONY: mocks
mocks: export PATH := $(GO_VERSION):$(PATH)
mocks: export PATH := $(GO_PATH):$(PATH)
mocks: MOCKGEN := ${GOPATH}/bin/mockgen --build_flags=--mod=mod
mocks: ## Generate mocks
$(GO) install github.com/golang/mock/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion internal/test/e2e/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"os"
"regexp"
"runtime"
"sort"
"strings"
"sync"
Expand Down Expand Up @@ -290,7 +291,8 @@ func RunTests(conf instanceRunConf, inventoryCatalogue map[string]*hardwareCatal

func (e *E2ESession) runTests(regex string) (testCommandResult *testCommandResult, err error) {
e.logger.V(1).Info("Running e2e tests", "regex", regex)
command := "GOVERSION=go1.16.6 gotestsum --junitfile=junit-testing.xml --raw-command --format=standard-verbose --hide-summary=all --ignore-non-json-output-lines -- test2json -t -p e2e ./bin/e2e.test -test.v"
goVersion := runtime.Version()
command := fmt.Sprintf("GOVERSION=%s gotestsum --junitfile=junit-testing.xml --raw-command --format=standard-verbose --hide-summary=all --ignore-non-json-output-lines -- test2json -t -p e2e ./bin/e2e.test -test.v", goVersion)

if regex != "" {
command = fmt.Sprintf("%s -test.run \"^(%s)$\" -test.timeout %s", command, regex, e2eTimeout)
Expand Down

0 comments on commit 111d8a5

Please sign in to comment.