-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·71 lines (61 loc) · 1.99 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·71 lines (61 loc) · 1.99 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
trap 'echo "$BASH_COMMAND (line $LINENO) failed, exiting..."; exit 1' ERR
set -euo pipefail
function usage() {
echo "Usage: $0 <version> <sgw_version> [--test-filter EXPR] [--setup-only]"
echo " <cbl_version>: The Couchbase Lite version to run the test against."
echo " <sgw_version>: Sync Gateway version to be deployed for the test."
echo " --test-filter: An optional pytest -k filter expression"
echo " --setup-only: Only build test server and setup backend, skip test execution"
echo " Build number will be auto-fetched for the specified version"
exit 1
}
if [ "$#" -lt 2 ]; then usage; fi
CBL_VERSION=${1}
SGW_VERSION=${2}
shift 2
TEST_FILTER=""
SETUP_ONLY=false
while [ "$#" -gt 0 ]; do
case "$1" in
--test-filter)
TEST_FILTER="$2"
shift 2
;;
--setup-only)
SETUP_ONLY=true
shift
;;
*)
echo "Unknown argument: $1"
usage
;;
esac
done
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
source "$SCRIPT_DIR"/../../shared/config.sh
section_start "$COLOR_CYAN" "INFRA SETUP"
pushd "$AWS_ENVIRONMENT_DIR" >/dev/null
uv run "$SCRIPT_DIR"/setup_test.py "$CBL_VERSION" "$SGW_VERSION"
popd >/dev/null
# Exit early if setup-only mode
if [ "$SETUP_ONLY" = true ]; then
echo "Setup completed. Exiting due to --setup-only flag."
exit 0
fi
# test_replication_xdcr.py needs two separate Couchbase Server clusters, which
# this single-cluster topology does not provide; it is deferred until the
# multi-cluster topology is sorted out rather than left to fail every night. See CBL-8686
section_start "$COLOR_YELLOW" "RUN TESTS"
pushd "$TESTS_DIR" >/dev/null
if [ -n "$TEST_FILTER" ]; then
uv run pytest -v --no-header --config QE/config.json \
--ignore=dev_e2e/test_replication_xdcr.py \
--sgcollect-on-test-failure \
-k "$TEST_FILTER" \
--no-result-upload
else
uv run pytest -v --no-header --config QE/config.json \
--ignore=dev_e2e/test_replication_xdcr.py \
--sgcollect-on-test-failure
fi