github.com/MetalBlockchain/metalgo@v1.11.9/scripts/build_test.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -euo pipefail
     4  
     5  # Directory above this script
     6  METAL_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
     7  # Load the constants
     8  source "$METAL_PATH"/scripts/constants.sh
     9  
    10  EXCLUDED_TARGETS="| grep -v /mocks | grep -v proto | grep -v tests/e2e | grep -v tests/upgrade"
    11  
    12  if [[ "$(go env GOOS)" == "windows" ]]; then
    13    # Test discovery for the antithesis test setups is broken due to
    14    # their dependence on the linux-only Antithesis SDK.
    15    EXCLUDED_TARGETS="${EXCLUDED_TARGETS} | grep -v tests/antithesis"
    16  fi
    17  
    18  TEST_TARGETS="$(eval "go list ./... ${EXCLUDED_TARGETS}")"
    19  
    20  # shellcheck disable=SC2086
    21  go test -shuffle=on -race -timeout="${TIMEOUT:-120s}" -coverprofile="coverage.out" -covermode="atomic" ${TEST_TARGETS}