Skip to content

fix(integ-runner): region not passed when deploying tests - #2131

Merged
aws-cdk-automation merged 1 commit into
mainfrom
huijbers/region-for-deployments
Nov 6, 2026
Merged

aws-cdk-automation merged 1 commit into
mainfrom
huijbers/region-for-deployments

Conversation

@rix0rrr

@rix0rrr rix0rrr commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

The current version of the integ-runner does not pass the CDK_DEFAULT_ACCOUNT and CDK_DEFAULT_REGION environment variables to the app that's being tested if it is being deployed.

This means that any feature that relies on the region being available, like lookups, doesn't work. Also tests that rely on stack.accountId and stack.region being resolved values (like the ProductStack tests) fail.

Make sure the region gets resolved when we are synthesizing for deployments.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

The current version of the integ-runner does not pass the
`CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` environment
variables to the app that's being tested if it is being deployed.

This means that any feature that relies on the region being available,
like lookups, doesn't work. Also tests that rely on `stack.accountId`
and `stack.region` being resolved values (like the `ProductStack` tests)
fail.

Make sure the region gets resolved when we are synthesizing for deployments.
@rix0rrr
rix0rrr requested a review from a team November 6, 2026 13:08
@rix0rrr
rix0rrr deployed to automation November 6, 2026 13:08 — with GitHub Actions Active
@github-actions github-actions Bot added the p2 label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@maintainer-for-aws

Copy link
Copy Markdown

Automated review

A maintainer will still review this — treat the notes below as a starting point.

📌 Commit 7587aa0

This PR fixes a bug in the integ-runner where CDK_DEFAULT_ACCOUNT/CDK_DEFAULT_REGION were not populated when deploying integration-test apps, so stacks using the recommended env pattern stayed environment-agnostic and failed to resolve a concrete region at synth time. The fix adds a SynthesisPurpose ('snapshot' | 'deployment') to the synth options and threads it from the test-app callers through the toolkit-lib engine, so default-environment resolution runs only for deployments while snapshots stay deterministic and environment-agnostic.

The change is small, internally consistent, and test-backed: the new required purpose field is propagated to every in-repo caller, the snapshot-vs-deployment mapping lines up with the existing context distinction, and the behavior is covered by a new positive test plus the retained snapshot-path tests. No issues found on this change.

🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional


Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.05%. Comparing base (611e948) to head (7587aa0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2131   +/-   ##
=======================================
  Coverage   92.05%   92.05%           
=======================================
  Files          82       82           
  Lines       13195    13195           
  Branches     1894     1895    +1     
=======================================
  Hits        12146    12146           
  Misses       1011     1011           
  Partials       38       38           
Flag Coverage Δ
suite.unit 92.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aws-cdk-automation
aws-cdk-automation added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 5ec9d01 Nov 6, 2026
49 checks passed
@aws-cdk-automation
aws-cdk-automation deleted the huijbers/region-for-deployments branch November 6, 2026 15:22

This branch was successfully deployed

1 active and 2 inactive deployments
run-tests — 7587aa04 Deployed Nov 6, 2026 by rix0rrr via integ_toolkit-lib (toolkit-lib-integ-tests, 24) #7642
no-approval — 7587aa04 Deployed Nov 6, 2026 by rix0rrr via prepare #7642
automation — 7587aa04 Deployed Nov 6, 2026 by rix0rrr via Set AutoQueue on PR #2131 #3964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants