From 34cb1205096341e87d56ea4ef0ac783e0adbaa0e Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Fri, 15 Aug 2025 12:42:42 -0700 Subject: [PATCH] fixes --- .github/workflows/record-integration-tests.yml | 4 ++-- scripts/integration-tests.sh | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/record-integration-tests.yml b/.github/workflows/record-integration-tests.yml index 4fe244e8e..f397ac495 100644 --- a/.github/workflows/record-integration-tests.yml +++ b/.github/workflows/record-integration-tests.yml @@ -1,7 +1,7 @@ -# This workflow should be run manually when needing to re-record tests. This happens when you have +# This workflow should be run manually when needing to re-record tests. This happens when you have # - added a new test # - or changed an existing test such that a new inference call is made -# You should make a PR and then run this workflow on that PR branch. The workflow will re-record the +# You should make a PR and then run this workflow on that PR branch. The workflow will re-record the # tests and commit the recordings to the PR branch. name: Integration Tests (Record) diff --git a/scripts/integration-tests.sh b/scripts/integration-tests.sh index 525baf5de..6e05c8f47 100755 --- a/scripts/integration-tests.sh +++ b/scripts/integration-tests.sh @@ -31,7 +31,7 @@ Options: --test-subdirs STRING Comma-separated list of test subdirectories to run (default: 'inference') --run-vision-tests Run vision tests instead of regular tests --inference-mode STRING Inference mode: record or replay (default: replay) - --test-pattern STRING Regex pattern to pass to pytest -k + --test-pattern STRING Regex pattern to pass to pytest -k --help Show this help message Examples: @@ -179,19 +179,26 @@ fi # Run vision tests if specified if [[ "$RUN_VISION_TESTS" == "true" ]]; then echo "Running vision tests..." - if uv run pytest -s -v tests/integration/inference/test_vision_inference.py \ + set +e + uv run pytest -s -v tests/integration/inference/test_vision_inference.py \ --stack-config="$STACK_CONFIG" \ -k "$PYTEST_PATTERN" \ --vision-model=ollama/llama3.2-vision:11b \ --embedding-model=sentence-transformers/all-MiniLM-L6-v2 \ --color=yes $EXTRA_PARAMS \ - --capture=tee-sys; then + --capture=tee-sys + exit_code=$? + set -e + + if [ $exit_code -eq 0 ]; then echo "✅ Vision tests completed successfully" + elif [ $exit_code -eq 5 ]; then + echo "⚠️ No vision tests collected (pattern matched no tests)" + exit 0 else echo "❌ Vision tests failed" exit 1 fi - exit 0 fi # Run regular tests