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

fix travis script #2701

Merged
merged 2 commits into from
Aug 6, 2020
Merged
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
18 changes: 9 additions & 9 deletions .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -ex

if [ ${TESTMODE} == "lint" ]; then
if [ "${TESTMODE}" == "lint" ]; then
.travis/no_ginkgo.sh
./bin/golangci-lint run ./...
fi

if [ ${TESTMODE} == "gogenerate" ]; then
if [ "${TESTMODE}" == "gogenerate" ]; then
find . -type f -name "*.go" -exec shasum {} \; > checksums_before.txt
# delete all go-generated files generated (that adhere to the comment convention)
grep --include \*.go --exclude-dir quictrace/ -lrIZ "^// Code generated .* DO NOT EDIT\.$" . | xargs --null rm
Expand All @@ -18,28 +18,28 @@ if [ ${TESTMODE} == "gogenerate" ]; then
# now generate everything
go generate ./...
find . -type f -name "*.go" -exec shasum {} \; > checksums_after.txt
DIFF=`diff checksums_before.txt checksums_after.txt`
echo $DIFF
if [ ! -z "$var" ]; then
DIFF=$(diff checksums_before.txt checksums_after.txt)
echo "$DIFF"
if [ -n "$DIFF" ]; then
exit 1
fi
fi

if [ ${TESTMODE} == "unit" ]; then
if [ "${TESTMODE}" == "unit" ]; then
ginkgo -r -v -cover -randomizeAllSpecs -randomizeSuites -trace -skipPackage integrationtests,benchmark
# run unit tests with the Go race detector
# The Go race detector only works on amd64.
if [ ${TRAVIS_GOARCH} == 'amd64' ]; then
if [ "${TRAVIS_GOARCH}" == 'amd64' ]; then
ginkgo -race -r -v -randomizeAllSpecs -randomizeSuites -trace -skipPackage integrationtests,benchmark
fi
fi

if [ ${TESTMODE} == "integration" ]; then
if [ "${TESTMODE}" == "integration" ]; then
# run benchmark tests
ginkgo -randomizeAllSpecs -randomizeSuites -trace benchmark -- -size=10
# run benchmark tests with the Go race detector
# The Go race detector only works on amd64.
if [ ${TRAVIS_GOARCH} == 'amd64' ]; then
if [ "${TRAVIS_GOARCH}" == 'amd64' ]; then
ginkgo -race -randomizeAllSpecs -randomizeSuites -trace benchmark -- -size=5
fi
# run integration tests
Expand Down