diff --git a/.github/actions/run-integration-tests/action.yml b/.github/actions/run-integration-tests/action.yml index 64b5f6627..7d93d2a61 100644 --- a/.github/actions/run-integration-tests/action.yml +++ b/.github/actions/run-integration-tests/action.yml @@ -27,6 +27,26 @@ outputs: runs: using: 'composite' steps: + - name: Run Llama Stack Server + if: ${{ contains(inputs.stack-config, 'server:') }} + run: | + # Run this so pytest in a loop doesn't start-stop servers in a loop + echo "Starting Llama Stack Server" + nohup uv run llama stack run ci-tests --image-type venv > server.log 2>&1 & + + echo "Waiting for Llama Stack Server to start" + for i in {1..30}; do + if curl -s http://localhost:8321/v1/health | grep -q "OK"; then + echo "Llama Stack Server started" + exit 0 + fi + sleep 1 + done + + echo "Llama Stack Server failed to start" + cat server.log + exit 1 + - name: Run Integration Tests env: LLAMA_STACK_CLIENT_TIMEOUT: "300" diff --git a/.github/actions/setup-test-environment/action.yml b/.github/actions/setup-test-environment/action.yml index 1d586acf8..eb473e3fc 100644 --- a/.github/actions/setup-test-environment/action.yml +++ b/.github/actions/setup-test-environment/action.yml @@ -16,19 +16,10 @@ inputs: description: 'Whether to setup provider for vision tests' required: false default: 'false' - inference-mode: - description: 'Inference mode (record or replay)' - required: true runs: using: 'composite' steps: - - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: ${{ inputs.inference-mode == 'record' && github.event.pull_request.head.ref || '' }} - fetch-depth: ${{ inputs.inference-mode == 'record' && '0' || '1' }} - - name: Install dependencies uses: ./.github/actions/setup-runner with: diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index ef823beb9..cf8a09b5f 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -93,13 +93,18 @@ jobs: pull-requests: write steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 0 + - name: Setup test environment uses: ./.github/actions/setup-test-environment with: python-version: "3.12" # Use single Python version for recording client-version: "latest" provider: ${{ inputs.test-provider || 'ollama' }} - inference-mode: 'record' - name: Run and record tests uses: ./.github/actions/run-and-record-tests @@ -125,6 +130,9 @@ jobs: client-version: ${{ (github.event.schedule == '0 0 * * 0' || github.event.inputs.test-all-client-versions == 'true') && fromJSON('["published", "latest"]') || fromJSON('["latest"]') }} steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Setup test environment uses: ./.github/actions/setup-test-environment with: diff --git a/.github/workflows/integration-vision-tests.yml b/.github/workflows/integration-vision-tests.yml index 3bf543bd8..c87b25e9f 100644 --- a/.github/workflows/integration-vision-tests.yml +++ b/.github/workflows/integration-vision-tests.yml @@ -70,13 +70,18 @@ jobs: pull-requests: write steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 0 + - name: Setup test environment uses: ./.github/actions/setup-test-environment with: python-version: "3.12" # Use single Python version for recording client-version: "latest" provider: 'ollama' - inference-mode: 'record' run-vision-tests: 'true' - name: Run and record tests @@ -103,6 +108,9 @@ jobs: client-version: ["latest"] steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Setup test environment uses: ./.github/actions/setup-test-environment with: