mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Fix the make test-coverage for s390x arch (#3765)
This commit is contained in:
@@ -4,12 +4,22 @@
|
|||||||
# go test can't generate code coverage for multiple packages in one command
|
# go test can't generate code coverage for multiple packages in one command
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
ARCH=$(uname -m)
|
||||||
echo "" > coverage.txt
|
echo "" > coverage.txt
|
||||||
go test -i -race ./cmd/odo
|
# The race detector is currently not supported on s390x .
|
||||||
|
if [ "${ARCH}" == "s390x" ]; then
|
||||||
|
go test -i ./cmd/odo
|
||||||
|
else
|
||||||
|
go test -i -race ./cmd/odo
|
||||||
|
fi
|
||||||
|
|
||||||
for d in $(go list ./... | grep -v vendor | grep -v tests); do
|
for d in $(go list ./... | grep -v vendor | grep -v tests); do
|
||||||
# For watch related tests, race check causes issue so disabling them here as race is already tested in other tests when used with `-coverprofile=profile.out`
|
# For watch related tests, race check causes issue so disabling them here as race is already tested in other tests when used with `-coverprofile=profile.out`
|
||||||
if [ "$d" = "github.com/openshift/odo/pkg/component" ]; then
|
if [ "$d" = "github.com/openshift/odo/pkg/component" ]; then
|
||||||
go test -coverprofile=profile.out -covermode=atomic $d
|
go test -coverprofile=profile.out -covermode=atomic $d
|
||||||
|
elif [ "${ARCH}" == "s390x" ]; then
|
||||||
|
# The race detector is currently not supported on s390x .
|
||||||
|
go test -coverprofile=profile.out -covermode=atomic $d
|
||||||
else
|
else
|
||||||
go test -race -coverprofile=profile.out -covermode=atomic $d
|
go test -race -coverprofile=profile.out -covermode=atomic $d
|
||||||
fi
|
fi
|
||||||
@@ -17,4 +27,4 @@ for d in $(go list ./... | grep -v vendor | grep -v tests); do
|
|||||||
cat profile.out >> coverage.txt
|
cat profile.out >> coverage.txt
|
||||||
rm profile.out
|
rm profile.out
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user