github.com/mutagen-io/mutagen@v0.18.0-rc1/scripts/ci/test.sh (about) 1 #!/bin/bash 2 3 # Exit immediately on failure. 4 set -e 5 6 # Load test parameters. 7 source scripts/ci/test_parameters.sh 8 9 # Perform a local build so that we have an agent bundle for integration tests. 10 if [[ "${MUTAGEN_TEST_ENABLE_SSPL}" == "true" ]]; then 11 go run scripts/build.go --mode=local --sspl 12 else 13 go run scripts/build.go --mode=local 14 fi 15 16 # Run tests and generate a coverage profile. 17 if [[ "${MUTAGEN_TEST_ENABLE_SSPL}" == "true" ]]; then 18 go test -tags mutagensspl -p 1 -v -coverpkg=./pkg/... -coverprofile=coverage.txt ./pkg/... 19 else 20 go test -p 1 -v -coverpkg=./pkg/... -coverprofile=coverage.txt ./pkg/... 21 fi 22 23 # Run tests with the race detector enabled. We use a slim end-to-end test since 24 # the race detector significantly increases the execution time. 25 if [[ "${MUTAGEN_TEST_ENABLE_SSPL}" == "true" ]]; then 26 MUTAGEN_TEST_END_TO_END="slim" go test -tags mutagensspl -p 1 -race ./pkg/... 27 else 28 MUTAGEN_TEST_END_TO_END="slim" go test -p 1 -race ./pkg/... 29 fi 30 31 # Run tests on SSPL code. We perform this test on all platforms, regardless of 32 # whether or not SSPL-licensed enhancements are enabled for regular tests. 33 go test -v -tags mutagensspl ./sspl/...