diff --git a/.github/actions/run-and-record-tests/action.yml b/.github/actions/run-and-record-tests/action.yml index d44cba4ee..a5520a571 100644 --- a/.github/actions/run-and-record-tests/action.yml +++ b/.github/actions/run-and-record-tests/action.yml @@ -62,7 +62,7 @@ runs: - name: Commit and push recordings - if: ${{ inputs.inference-mode == 'record' }} + if: ${{ inputs.inference-mode == 'record' || inputs.inference-mode == 'record-if-missing' }} shell: bash run: | echo "Checking for recording changes" diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index f3b5b95a9..2eb64382f 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -48,6 +48,10 @@ on: type: string default: 'default' description: 'Matrix configuration key from ci_matrix.json (e.g., "default", "stainless")' + pr_head_sha: + required: false + type: string + description: 'The SHA of the pull request head to checkout' test-all-client-versions: required: false type: boolean @@ -67,6 +71,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + ref: ${{ inputs.pr_head_sha || github.event.pull_request.head.sha || github.sha }} - name: Generate test matrix id: set-matrix @@ -100,6 +106,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + ref: ${{ inputs.pr_head_sha || github.event.pull_request.head.sha || github.sha }} - name: Setup test environment if: ${{ matrix.config.allowed_clients == null || contains(matrix.config.allowed_clients, matrix.client) }} @@ -110,7 +118,7 @@ jobs: sdk_install_url: ${{ inputs.sdk_install_url || '' }} setup: ${{ matrix.config.setup }} suite: ${{ matrix.config.suite }} - inference-mode: 'replay' + inference-mode: ${{ matrix.config.inference_mode || 'replay' }} - name: Setup Node.js for TypeScript client tests if: ${{ matrix.client == 'server' }} @@ -140,5 +148,5 @@ jobs: || (matrix.client == 'server' && 'server:ci-tests') || 'docker:ci-tests' }} setup: ${{ matrix.config.setup }} - inference-mode: 'replay' + inference-mode: ${{ matrix.config.inference_mode || 'replay' }} suite: ${{ matrix.config.suite }} diff --git a/.github/workflows/stainless-builds.yml b/.github/workflows/stainless-builds.yml index 880324756..e25b2103e 100644 --- a/.github/workflows/stainless-builds.yml +++ b/.github/workflows/stainless-builds.yml @@ -181,6 +181,7 @@ jobs: sdk_install_url: ${{ inputs.sdk_install_url || needs.preview.outputs.sdk_install_url }} matrix_key: 'stainless' test-all-client-versions: false + pr_head_sha: ${{ needs.compute-branch.outputs.pr_head_sha }} merge: needs: compute-branch diff --git a/tests/integration/ci_matrix.json b/tests/integration/ci_matrix.json index fcadf95df..623acfbdf 100644 --- a/tests/integration/ci_matrix.json +++ b/tests/integration/ci_matrix.json @@ -7,7 +7,7 @@ {"suite": "base-vllm-subset", "setup": "vllm"} ], "stainless": [ - {"suite": "base", "setup": "ollama", "allowed_clients": ["library"]} + {"suite": "base", "setup": "ollama", "allowed_clients": ["library"], "inference_mode": "record-if-missing"} ], "schedules": { "1 0 * * 0": [