forked from digitalocean/gradient-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmoke
More file actions
executable file
·47 lines (39 loc) · 1.13 KB
/
smoke
File metadata and controls
executable file
·47 lines (39 loc) · 1.13 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
#!/usr/bin/env bash
# Purpose: Run live smoke tests (sync + async) against real Gradient services.
# These tests require valid credentials and are excluded from the normal test run.
# Usage:
# ./scripts/smoke # run all smoke tests
# ./scripts/smoke -k agents # pass through extra pytest args
#
# If a .env file exists in the repo root it will be sourced automatically.
set -euo pipefail
cd "$(dirname "$0")/.."
if [ -f .env ]; then
echo "==> Loading .env"
# export variables declared in .env
set -a
# shellcheck disable=SC1091
source .env
set +a
fi
required=(
DIGITALOCEAN_ACCESS_TOKEN
GRADIENT_MODEL_ACCESS_KEY
GRADIENT_AGENT_ACCESS_KEY
GRADIENT_AGENT_ENDPOINT
)
missing=()
for var in "${required[@]}"; do
if [ -z "${!var:-}" ]; then
missing+=("$var")
fi
done
if [ ${#missing[@]} -ne 0 ]; then
echo "ERROR: Missing required environment variables for smoke tests:" >&2
printf ' %s\n' "${missing[@]}" >&2
echo >&2
echo "Provide them via your shell environment or a .env file (see .env.example)." >&2
exit 1
fi
echo "==> Running smoke tests (marker: smoke)"
rye run pytest -m smoke "$@"