parallel travis tests

pull/5459/head
Medya Gh 2019-09-25 08:33:34 -07:00
parent 8e138a7eea
commit c97aa4dcc1
2 changed files with 42 additions and 29 deletions

View File

@ -1,8 +1,13 @@
language: go
os: linux
env:
global:
- GOPROXY=https://proxy.golang.org
matrix:
- TESTSUITE_LINT=true
- TESTSUITE_BOILERPLATE=true
- TESTSUITE_UNIT=true
matrix:
include:
- go: 1.12.9

12
test.sh
View File

@ -15,16 +15,21 @@
# limitations under the License.
set -eu -o pipefail
# TODO: fix exit code numbers
# TODO: make test should work locally as it was before
exitcode=0
echo "= go mod ================================================================"
go mod download 2>&1 | grep -v "go: finding" || true
go mod tidy -v && echo ok || ((exitcode += 2))
if [ ! -z "$TESTSUITE_LINT"] then
echo "= make lint ============================================================="
make -s lint-ci && echo ok || ((exitcode += 4))
fi
if [ ! -z "$TESTSUITE_BOILERPLATE"] then
echo "= boilerplate ==========================================================="
readonly PYTHON=$(type -P python || echo docker run --rm -it -v $(pwd):/minikube -w /minikube python python)
readonly BDIR="./hack/boilerplate"
@ -36,10 +41,12 @@ if [[ -n "${missing}" ]]; then
else
echo "ok"
fi
echo "= schema_check =========================================================="
go run deploy/minikube/schema_check.go >/dev/null && echo ok || ((exitcode += 8))
fi
if [ ! -z "$TESTSUITE_UNIT"] then
echo "= go test ==============================================================="
cov_tmp="$(mktemp)"
readonly COVERAGE_PATH=./out/coverage.txt
@ -51,5 +58,6 @@ go test \
-coverprofile="${cov_tmp}" \
${pkgs} && echo ok || ((exitcode += 16))
tail -n +2 "${cov_tmp}" >>"${COVERAGE_PATH}"
fi
exit "${exitcode}"