feat(ci): add --typescript-only flag to skip Python tests in integration test script

The TypeScript client CI workflow currently fails because it depends on Python
tests passing first, but version mismatches between llama-stack client versions
can cause Python tests to fail even when the TypeScript client is working fine.

This adds a `--typescript-only` flag to scripts/integration-tests.sh that:
- Skips pytest execution entirely when enabled
- Still starts the Llama Stack server (required for TS client tests)
- Proceeds directly to running TypeScript client tests

The TypeScript client can now be tested independently by calling:
  ./scripts/integration-tests.sh --stack-config server:ci-tests --typescript-only

Test plan: Verified flag parsing, conditional pytest skip, and help text update.
This commit is contained in:
Ashwin Bharambe 2025-11-19 15:18:22 -08:00
parent 8852666982
commit f219a91d42

View file

@ -20,6 +20,7 @@ TEST_PATTERN=""
INFERENCE_MODE="replay" INFERENCE_MODE="replay"
EXTRA_PARAMS="" EXTRA_PARAMS=""
COLLECT_ONLY=false COLLECT_ONLY=false
TYPESCRIPT_ONLY=false
# Function to display usage # Function to display usage
usage() { usage() {
@ -34,6 +35,7 @@ Options:
--subdirs STRING Comma-separated list of test subdirectories to run (overrides suite) --subdirs STRING Comma-separated list of test subdirectories to run (overrides suite)
--pattern STRING Regex pattern to pass to pytest -k --pattern STRING Regex pattern to pass to pytest -k
--collect-only Collect tests only without running them (skips server startup) --collect-only Collect tests only without running them (skips server startup)
--typescript-only Skip Python tests and run only TypeScript client tests
--help Show this help message --help Show this help message
Suites are defined in tests/integration/suites.py and define which tests to run. Suites are defined in tests/integration/suites.py and define which tests to run.
@ -90,6 +92,10 @@ while [[ $# -gt 0 ]]; do
COLLECT_ONLY=true COLLECT_ONLY=true
shift shift
;; ;;
--typescript-only)
TYPESCRIPT_ONLY=true
shift
;;
--help) --help)
usage usage
exit 0 exit 0
@ -544,7 +550,9 @@ if [[ -n "$STACK_CONFIG" ]]; then
STACK_CONFIG_ARG="--stack-config=$STACK_CONFIG" STACK_CONFIG_ARG="--stack-config=$STACK_CONFIG"
fi fi
pytest -s -v $PYTEST_TARGET \ # Run Python tests unless typescript-only mode
if [[ "$TYPESCRIPT_ONLY" == "false" ]]; then
pytest -s -v $PYTEST_TARGET \
$STACK_CONFIG_ARG \ $STACK_CONFIG_ARG \
--inference-mode="$INFERENCE_MODE" \ --inference-mode="$INFERENCE_MODE" \
-k "$PYTEST_PATTERN" \ -k "$PYTEST_PATTERN" \
@ -553,7 +561,12 @@ pytest -s -v $PYTEST_TARGET \
--embedding-model=sentence-transformers/nomic-ai/nomic-embed-text-v1.5 \ --embedding-model=sentence-transformers/nomic-ai/nomic-embed-text-v1.5 \
--color=yes $EXTRA_PARAMS \ --color=yes $EXTRA_PARAMS \
--capture=tee-sys --capture=tee-sys
exit_code=$? exit_code=$?
else
echo "Skipping Python tests (--typescript-only mode)"
exit_code=0
fi
set +x set +x
set -e set -e