From bf7ab081519c3f6cad17ca441ec160a157ec15ff Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Dec 2025 17:18:58 +0000 Subject: [PATCH] Fix pytest worker auto-detection in run-branch-test.yml The test-target job was missing worker auto-detection logic, directly using inputs.parallel_workers without fallback. When empty (default), this caused pytest to receive "-n" without a value, failing with: "error: argument -n/--numprocesses: expected one argument" Applied the same auto-detection logic from test-py-pytest.yml: - Multithreaded runner: 6 workers - Singlethreaded runner: 1 worker (no -n flag) --- .github/workflows/run-branch-test.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-branch-test.yml b/.github/workflows/run-branch-test.yml index a57bcc0..39e1dcb 100644 --- a/.github/workflows/run-branch-test.yml +++ b/.github/workflows/run-branch-test.yml @@ -309,10 +309,21 @@ jobs: steps.final-status.outputs.cache_hit != 'true' && steps.check-collection.outputs.has_collection_errors != 'true' run: | - echo "🧪 Running tests with ${{ inputs.parallel_workers }} workers..." + # Determine worker count based on input or runner type + WORKERS="${{ inputs.parallel_workers }}" + if [ -z "$WORKERS" ]; then + # Auto-detect based on runner type + if echo '${{ inputs.runs_on }}' | grep -q "multithreaded"; then + WORKERS="6" + else + WORKERS="1" + fi + fi + echo "🧪 Running tests with $WORKERS workers..." + PARALLEL_FLAG="" - if [ "${{ inputs.parallel_workers }}" != "1" ]; then - PARALLEL_FLAG="-n ${{ inputs.parallel_workers }}" + if [ "$WORKERS" != "1" ]; then + PARALLEL_FLAG="-n $WORKERS" fi # Run pytest and capture exit code