Skip to content

Commit

Permalink
unit-tests: Invoke unit tests using go test directly instead of ginkg…
Browse files Browse the repository at this point in the history
…o cli (#3104)

Saves having to install the gingko cli for unit tests.
Additionally, this brings HCO more in line with how the kubevirt/cdi invokes
unit-tests with go.
Lastly invoking the tests with ginkgo on s390x causes it to randomly hang
forever.

Signed-off-by: Jan Schintag <jan.schintag@de.ibm.com>
  • Loading branch information
jschintag authored Sep 26, 2024
1 parent a44b3fe commit 30d4a3e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hack/build-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ JOB_TYPE="${JOB_TYPE:-}"
if [ "${JOB_TYPE}" == "travis" ]; then
go get -v -t ./...
go install github.com/mattn/goveralls@latest
go install github.com/onsi/ginkgo/v2/ginkgo@$(grep github.com/onsi/ginkgo go.mod | cut -d " " -f2)
go mod vendor
PKG_PACKAGE_PATH="./pkg/"
CONTROLLERS_PACKAGE_PATH="./controllers/"
mkdir -p coverprofiles
# Workaround - run tests on webhooks first to prevent failure when running all the test in the following line.
ginkgo -r ${PKG_PACKAGE_PATH}webhooks
ginkgo -cover -output-dir=./coverprofiles -coverprofile=cover.coverprofile -r ${PKG_PACKAGE_PATH} -r ${CONTROLLERS_PACKAGE_PATH}
go test ${PKG_PACKAGE_PATH}webhooks/...
go test -v -outputdir=./coverprofiles -coverprofile=cover.coverprofile ${PKG_PACKAGE_PATH}... ${CONTROLLERS_PACKAGE_PATH}...
else
test_path="./tests/func-tests"
GOFLAGS='' go install github.com/onsi/ginkgo/v2/ginkgo@$(grep github.com/onsi/ginkgo go.mod | cut -d " " -f2)
Expand Down

0 comments on commit 30d4a3e

Please sign in to comment.