Skip to content

Commit

Permalink
Unset debugging stuff and add inline docs
Browse files Browse the repository at this point in the history
  • Loading branch information
trevrosen committed Nov 5, 2017
1 parent d23b159 commit 93498d7
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions ci/test.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/bin/bash
set -euo pipefail

# Print commands as executed
#set -x

## Only uncomment the below for debugging
#set -euxo pipefail

# Hold the package names that contain failures
fail_packages=()
FAIL_PACKAGES=()

pushd $PWD/..
# Set up coverage report file
Expand All @@ -19,21 +17,21 @@ pushd $PWD/..
# Iterate over all non-vendor packages and run tests with coverage
for package in $EXCLUDING_VENDOR; do \
result=$(go test -covermode=count -coverprofile=tmp.cov $package)
echo $result

# If a `go test` command has failures, it will exit 1
# a go vet check should exit 2
# a go vet check should exit 2 (https://github.com/golang/go/blob/master/src/cmd/vet/all/main.go#L58)
# `go test` contains `vet` was introduced in this Change https://go-review.googlesource.com/c/go/+/74356
if [ $? -eq 1 ]; then
fail_packages+=($package);
FAIL_PACKAGES+=($package);
fi;
echo "$result"
if [ -f tmp.cov ]; then
cat tmp.cov >> profile.cov;
rm tmp.cov;
fi;
done

# exit 1 if there have been any test failures
if [ ${#fails[@]} -ne 0 ]; then
if [ ${#FAIL_PACKAGES[@]} -ne 0 ]; then
exit 1
fi;
popd

0 comments on commit 93498d7

Please sign in to comment.