Skip to content

Commit 4f06fca

Browse files
committed
Skip network tests by default in .ci/gate
* Default marker excludes `network` unless opted in * Clarify `GATE_REAL` and `GATE_NETWORK` in `.ci/gate` Co-authored-by: AI <[email protected]>
1 parent d9d45f3 commit 4f06fca

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.ci/gate

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
set -euo pipefail
33

44
# Local CI for Python projects.
5-
# - Default skips live/real tests.
5+
# - Default skips live/real tests and network tests.
6+
# - Real tests may call external APIs and require credentials.
67
# - Opt in with: GATE_REAL=1 gate
8+
# - Opt in for network tests with: GATE_NETWORK=1 gate
79
# - Or pass custom args: GATE_PYTEST_ARGS='-m real' gate
810

911
uvx ruff format --check .
@@ -12,8 +14,17 @@ uvx ruff check .
1214
py_versions=(3.10 3.11 3.12 3.13 3.14)
1315

1416
pytest_args=()
17+
marker_expr=()
1518
if [ "${GATE_REAL:-}" != "1" ] && [ "${GATE_REAL:-}" != "true" ]; then
16-
pytest_args+=("-m" "not real")
19+
marker_expr+=("not real")
20+
fi
21+
if [ "${GATE_NETWORK:-}" != "1" ] && [ "${GATE_NETWORK:-}" != "true" ]; then
22+
marker_expr+=("not network")
23+
fi
24+
if [ "${#marker_expr[@]}" -gt 0 ]; then
25+
marker_joined=$(printf "%s and " "${marker_expr[@]}")
26+
marker_joined=${marker_joined% and }
27+
pytest_args+=("-m" "$marker_joined")
1728
fi
1829
if [ -n "${GATE_PYTEST_ARGS:-}" ]; then
1930
read -r -a extra_args <<<"${GATE_PYTEST_ARGS}"

0 commit comments

Comments
 (0)