This commit is contained in:
Ashwin Bharambe 2025-08-15 16:38:05 -07:00
parent b04468ca78
commit 544a2d5fc9
2 changed files with 45 additions and 18 deletions

View file

@ -35,6 +35,16 @@ jobs:
contents: write contents: write
steps: steps:
- name: Echo workflow inputs
run: |
echo "::group::Workflow Inputs"
echo "test-subdirs: ${{ inputs.test-subdirs }}"
echo "test-provider: ${{ inputs.test-provider }}"
echo "run-vision-tests: ${{ inputs.run-vision-tests }}"
echo "test-pattern: ${{ inputs.test-pattern }}"
echo "branch: ${{ github.ref_name }}"
echo "::endgroup::"
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with: with:

View file

@ -27,33 +27,35 @@ Trigger the integration test recording workflow remotely. This way you do not ne
OPTIONS: OPTIONS:
-b, --branch BRANCH Branch to run the workflow on (defaults to current branch) -b, --branch BRANCH Branch to run the workflow on (defaults to current branch)
-s, --test-subdirs DIRS Comma-separated list of test subdirectories to run -s, --test-subdirs DIRS Comma-separated list of test subdirectories to run (REQUIRED)
-p, --test-provider PROVIDER Test provider to use (default: ollama) -p, --test-provider PROVIDER Test provider to use: vllm or ollama (default: ollama)
-v, --run-vision-tests Include vision tests in the recording -v, --run-vision-tests Include vision tests in the recording
-k, --test-pattern PATTERN Regex pattern to pass to pytest -k -k, --test-pattern PATTERN Regex pattern to pass to pytest -k
-h, --help Show this help message -h, --help Show this help message
EXAMPLES: EXAMPLES:
# Record tests for current branch with default settings # Record tests for current branch with agents subdirectory
$0 $0 --test-subdirs "agents"
# Record tests for specific branch with vision tests # Record tests for specific branch with vision tests
$0 -b my-feature-branch -v $0 -b my-feature-branch --test-subdirs "inference" --run-vision-tests
# Record only specific test subdirectories # Record multiple test subdirectories with specific provider
$0 -s "agents,inference" -p openai $0 --test-subdirs "agents,inference" --test-provider vllm
# Record tests matching a specific pattern # Record tests matching a specific pattern
$0 -k "test_streaming" $0 --test-subdirs "inference" --test-pattern "test_streaming"
PREREQUISITES:
- GitHub CLI (gh) must be installed and authenticated
- You must be in a git repository that is a fork or clone of llamastack/llama-stack
- The branch must exist on the remote repository where you want to run the workflow
EOF EOF
} }
# PREREQUISITES:
# - GitHub CLI (gh) must be installed and authenticated
# - jq must be installed for JSON parsing
# - You must be in a git repository that is a fork or clone of llamastack/llama-stack
# - The branch must exist on the remote repository where you want to run the workflow
# - You must specify test subdirectories to run with -s/--test-subdirs
# Parse command line arguments # Parse command line arguments
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
@ -89,6 +91,24 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
# Validate required parameters
if [[ -z "$TEST_SUBDIRS" ]]; then
echo "Error: --test-subdirs is required"
echo "Please specify which test subdirectories to run, e.g.:"
echo " $0 --test-subdirs \"agents,inference\""
echo " $0 --test-subdirs \"inference\" --run-vision-tests"
echo ""
exit 1
fi
# Validate test provider
if [[ "$TEST_PROVIDER" != "vllm" && "$TEST_PROVIDER" != "ollama" ]]; then
echo "❌ Error: Invalid test provider '$TEST_PROVIDER'"
echo " Supported providers: vllm, ollama"
echo " Example: $0 --test-subdirs \"agents\" --test-provider vllm"
exit 1
fi
# Check if required tools are installed # Check if required tools are installed
if ! command -v gh &> /dev/null; then if ! command -v gh &> /dev/null; then
echo "Error: GitHub CLI (gh) is not installed. Please install it from https://cli.github.com/" echo "Error: GitHub CLI (gh) is not installed. Please install it from https://cli.github.com/"
@ -218,16 +238,13 @@ fi
echo "Triggering integration test recording workflow..." echo "Triggering integration test recording workflow..."
echo "Branch: $BRANCH" echo "Branch: $BRANCH"
echo "Test provider: $TEST_PROVIDER" echo "Test provider: $TEST_PROVIDER"
echo "Test subdirs: ${TEST_SUBDIRS:-"(all)"}" echo "Test subdirs: $TEST_SUBDIRS"
echo "Run vision tests: $RUN_VISION_TESTS" echo "Run vision tests: $RUN_VISION_TESTS"
echo "Test pattern: ${TEST_PATTERN:-"(none)"}" echo "Test pattern: ${TEST_PATTERN:-"(none)"}"
echo "" echo ""
# Prepare inputs for gh workflow run # Prepare inputs for gh workflow run
INPUTS="" INPUTS="-f test-subdirs='$TEST_SUBDIRS'"
if [[ -n "$TEST_SUBDIRS" ]]; then
INPUTS="$INPUTS -f test-subdirs='$TEST_SUBDIRS'"
fi
if [[ -n "$TEST_PROVIDER" ]]; then if [[ -n "$TEST_PROVIDER" ]]; then
INPUTS="$INPUTS -f test-provider='$TEST_PROVIDER'" INPUTS="$INPUTS -f test-provider='$TEST_PROVIDER'"
fi fi