forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_test.sh
More file actions
executable file
·33 lines (25 loc) · 1.09 KB
/
build_test.sh
File metadata and controls
executable file
·33 lines (25 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
set -euo pipefail
# Directory above this script
AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
# Load the constants
source "$AVALANCHE_PATH"/scripts/constants.sh
# Run the tests with shuffling unless NO_SHUFFLE is set.
shuffle="-shuffle=on"
if [[ -n "${NO_SHUFFLE:-}" ]]; then
shuffle=""
fi
# Run the tests with race detection unless NO_RACE is set.
race="-race"
if [[ -n "${NO_RACE:-}" ]]; then
race=""
fi
EXCLUDED_TARGETS="| grep -v /mocks | grep -v proto | grep -v tests/e2e | grep -v tests/load/c | grep -v tests/upgrade | grep -v tests/fixture/bootstrapmonitor/e2e | grep -v tests/reexecute"
if [[ "$(go env GOOS)" == "windows" ]]; then
# Test discovery for the antithesis test setups is broken due to
# their dependence on the linux-only Antithesis SDK.
EXCLUDED_TARGETS="${EXCLUDED_TARGETS} | grep -v tests/antithesis"
fi
TEST_TARGETS="$(eval "go list ./... ${EXCLUDED_TARGETS}")"
# shellcheck disable=SC2086
go test -tags test ${shuffle:-} ${race:-} -timeout="${TIMEOUT:-120s}" -coverprofile="coverage.out" -covermode="atomic" ${TEST_TARGETS}