File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22set -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
911uvx ruff format --check .
@@ -12,8 +14,17 @@ uvx ruff check .
1214py_versions=(3.10 3.11 3.12 3.13 3.14)
1315
1416pytest_args=()
17+ marker_expr=()
1518if [ " ${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 " )
1728fi
1829if [ -n " ${GATE_PYTEST_ARGS:- } " ]; then
1930 read -r -a extra_args <<< " ${GATE_PYTEST_ARGS}"
You can’t perform that action at this time.
0 commit comments