From f7f3c0c562a0d59ee1778741030b54332d826bd9 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Thu, 31 Jul 2025 11:26:35 -0700 Subject: [PATCH] add force-inference-mode --- .github/workflows/integration-tests.yml | 14 ++++++++++++-- .github/workflows/integration-vision-tests.yml | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index b893ce2ca..ed14d107c 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -31,6 +31,10 @@ on: description: 'Test against a specific provider' type: string default: 'ollama' + force-inference-mode: + description: 'Force inference mode (record or replay)' + type: string + default: '' concurrency: # This creates three concurrency groups: @@ -75,10 +79,16 @@ jobs: - name: Check if re-record-tests label exists id: check-rerecord-tests run: | - if [[ "${{ contains(github.event.pull_request.labels.*.name, 're-record-tests') }}" == "true" ]]; then + if [[ "${{ inputs.force-inference-mode }}" == "record" ]]; then echo "rerecord-tests=true" >> $GITHUB_OUTPUT - else + elif [[ "${{ inputs.force-inference-mode }}" == "replay" ]]; then echo "rerecord-tests=false" >> $GITHUB_OUTPUT + else + if [[ "${{ contains(github.event.pull_request.labels.*.name, 're-record-tests') }}" == "true" ]]; then + echo "rerecord-tests=true" >> $GITHUB_OUTPUT + else + echo "rerecord-tests=false" >> $GITHUB_OUTPUT + fi fi record-tests: diff --git a/.github/workflows/integration-vision-tests.yml b/.github/workflows/integration-vision-tests.yml index 1c07d034c..04a9e0f93 100644 --- a/.github/workflows/integration-vision-tests.yml +++ b/.github/workflows/integration-vision-tests.yml @@ -23,6 +23,10 @@ on: description: 'Test against both the latest and published versions' type: boolean default: false + force-inference-mode: + description: 'Force inference mode (record or replay)' + type: string + default: '' concurrency: group: >- @@ -52,10 +56,16 @@ jobs: - name: Check if re-record-tests label exists id: check-rerecord-tests run: | - if [[ "${{ contains(github.event.pull_request.labels.*.name, 're-record-tests') }}" == "true" ]]; then + if [[ "${{ inputs.force-inference-mode }}" == "record" ]]; then echo "rerecord-tests=true" >> $GITHUB_OUTPUT - else + elif [[ "${{ inputs.force-inference-mode }}" == "replay" ]]; then echo "rerecord-tests=false" >> $GITHUB_OUTPUT + else + if [[ "${{ contains(github.event.pull_request.labels.*.name, 're-record-tests') }}" == "true" ]]; then + echo "rerecord-tests=true" >> $GITHUB_OUTPUT + else + echo "rerecord-tests=false" >> $GITHUB_OUTPUT + fi fi record-tests: