-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-integration.sh
More file actions
executable file
·32 lines (29 loc) · 1008 Bytes
/
test-integration.sh
File metadata and controls
executable file
·32 lines (29 loc) · 1008 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
# Runs integration tests with practical defaults.
#
# Defaults:
# INTEGRATION_BACKEND=all
# GOCACHE=<shell default> (unless explicitly set in env)
# INTEGRATION_PKG=./integration/...
#
# Examples:
# ./scripts/test-integration.sh
# INTEGRATION_BACKEND=redis ./scripts/test-integration.sh
# INTEGRATION_BACKEND=all ./scripts/test-integration.sh -run TestObservabilityIntegration_ProcessEvents_AllBackends -v
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BACKEND="${INTEGRATION_BACKEND:-all}"
PKG="${INTEGRATION_PKG:-./integration/...}"
cd "$ROOT_DIR"
echo "==> running integration tests"
echo " backend: $BACKEND"
echo " package: $PKG"
if [[ -n "${GOCACHE:-}" ]]; then
echo " gocache: $GOCACHE"
INTEGRATION_BACKEND="$BACKEND" GOCACHE="$GOCACHE" \
go test -tags integration "$PKG" -count=1 "$@"
else
echo " gocache: <shell default>"
INTEGRATION_BACKEND="$BACKEND" \
go test -tags integration "$PKG" -count=1 "$@"
fi