From f6f91b3bc8bc3dc35a9e74431500fc357eea4af3 Mon Sep 17 00:00:00 2001 From: qwen-code-dev-bot Date: Mon, 31 Aug 2026 06:48:36 +0000 Subject: [PATCH] fix(ci): map RUNNER_ENVIRONMENT at step level in release integration jobs (#10604) Co-authored-by: Qwen-Coder --- .github/workflows/release.yml | 22 ++++++++++++++++++-- scripts/tests/release-workflow.test.js | 28 ++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ae679ef83c..5fb36f226cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -401,7 +401,6 @@ jobs: OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}' OPENAI_BASE_URL: '${{ secrets.OPENAI_BASE_URL }}' OPENAI_MODEL: '${{ secrets.OPENAI_MODEL }}' - RUNNER_ENVIRONMENT: '${{ runner.environment }}' steps: # Shared ECS runners can retain root-owned files from an earlier @@ -447,10 +446,20 @@ jobs: npm run bundle - name: 'Run CLI Integration Tests' + env: + # Mapped for integration-tests/vitest.config.ts, which caps each + # shared-pool shard at one fork and exempts pressure-flake + # unhandled errors. + RUNNER_ENVIRONMENT: '${{ runner.environment }}' run: |- npm run test:integration:cli:sandbox:none - name: 'Run Interactive Integration Tests' + env: + # Mapped for integration-tests/vitest.config.ts, which caps each + # shared-pool shard at one fork and exempts pressure-flake + # unhandled errors. + RUNNER_ENVIRONMENT: '${{ runner.environment }}' run: |- npm run test:integration:interactive:sandbox:none @@ -467,7 +476,6 @@ jobs: OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}' OPENAI_BASE_URL: '${{ secrets.OPENAI_BASE_URL }}' OPENAI_MODEL: '${{ secrets.OPENAI_MODEL }}' - RUNNER_ENVIRONMENT: '${{ runner.environment }}' steps: # Shared ECS runners can retain root-owned files from an earlier @@ -530,12 +538,22 @@ jobs: npm run build:sandbox -- -s - name: 'Run CLI Docker Integration Tests' + env: + # Mapped for integration-tests/vitest.config.ts, which caps each + # shared-pool shard at one fork and exempts pressure-flake + # unhandled errors. + RUNNER_ENVIRONMENT: '${{ runner.environment }}' run: |- # The package.json docker test scripts each rebuild the sandbox image. # Run vitest directly here so this job reuses the image built above. QWEN_SANDBOX=docker npx vitest run --root ./integration-tests cli - name: 'Run Interactive Docker Integration Tests' + env: + # Mapped for integration-tests/vitest.config.ts, which caps each + # shared-pool shard at one fork and exempts pressure-flake + # unhandled errors. + RUNNER_ENVIRONMENT: '${{ runner.environment }}' run: |- QWEN_SANDBOX=docker npx vitest run --root ./integration-tests interactive diff --git a/scripts/tests/release-workflow.test.js b/scripts/tests/release-workflow.test.js index 063566fd618..02eee7f65f5 100644 --- a/scripts/tests/release-workflow.test.js +++ b/scripts/tests/release-workflow.test.js @@ -1204,10 +1204,30 @@ describe('release lane runner routing', () => { }); it('passes the runner environment to integration test configuration', () => { - for (const name of ['integration_none', 'integration_docker']) { - expect(releaseYaml.jobs[name].env.RUNNER_ENVIRONMENT, name).toBe( - '${{ runner.environment }}', - ); + // The `runner` context is not available in job-level `env:` — it expands + // to an empty string there (and fails actionlint), silently disabling the + // ECS limits. The mapping must sit on each step that starts a vitest run + // reading it in integration-tests/vitest.config.ts. + const integrationSteps = { + integration_none: [ + 'Run CLI Integration Tests', + 'Run Interactive Integration Tests', + ], + integration_docker: [ + 'Run CLI Docker Integration Tests', + 'Run Interactive Docker Integration Tests', + ], + }; + for (const [name, stepNames] of Object.entries(integrationSteps)) { + const job = releaseYaml.jobs[name]; + expect(job.env.RUNNER_ENVIRONMENT, name).toBeUndefined(); + for (const stepName of stepNames) { + const step = job.steps.find((s) => s.name === stepName); + expect(step, `step missing from ${name}: ${stepName}`).toBeTruthy(); + expect(step.env.RUNNER_ENVIRONMENT, `${name}/${stepName}`).toBe( + '${{ runner.environment }}', + ); + } } });