Skip to content

Commit bfb2744

Browse files
authored
feat: allow configuring atmosphere service for cli integ tests (#837)
* mid work * mid work
1 parent 5382dc8 commit bfb2744

File tree

4 files changed

+1137
-6
lines changed

4 files changed

+1137
-6
lines changed

API.md

+75
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cdk-cli-integ-tests.ts

+36-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@ import { Component, github, javascript } from 'projen';
22

33
const NOT_FLAGGED_EXPR = "!contains(github.event.pull_request.labels.*.name, 'pr/exempt-integ-test')";
44

5+
/**
6+
* Options for atmosphere service usage.
7+
*/
8+
export interface AtmosphereOptions {
9+
/**
10+
* Atmosphere service endpoint.
11+
*/
12+
readonly endpoint: string;
13+
/**
14+
* Which pool to retrieve environments from.
15+
*/
16+
readonly pool: string;
17+
/**
18+
* OIDC role to assume prior to using atmosphere. Must be allow listed
19+
* on the service endpoint.
20+
*/
21+
readonly oidcRoleArn: string;
22+
}
23+
524
export interface CdkCliIntegTestsWorkflowProps {
625
/**
726
* Runners for the workflow
@@ -49,6 +68,13 @@ export interface CdkCliIntegTestsWorkflowProps {
4968
* @default - No upstream versions
5069
*/
5170
readonly allowUpstreamVersions?: string[];
71+
72+
/**
73+
* Enable atmosphere service to retrieve AWS test environments.
74+
*
75+
* @default - atmosphere is not used
76+
*/
77+
readonly enableAtmosphere?: AtmosphereOptions;
5278
}
5379

5480
/**
@@ -286,7 +312,7 @@ export class CdkCliIntegTestsWorkflow extends Component {
286312
'aws-region': 'us-east-1',
287313
'role-duration-seconds': 4 * 60 * 60,
288314
// Expect this in Environment Variables
289-
'role-to-assume': '${{ vars.AWS_ROLE_TO_ASSUME_FOR_TESTING }}',
315+
'role-to-assume': props.enableAtmosphere ? props.enableAtmosphere.oidcRoleArn : '${{ vars.AWS_ROLE_TO_ASSUME_FOR_TESTING }}',
290316
'role-session-name': 'run-tests@aws-cdk-cli-integ',
291317
'output-credentials': true,
292318
},
@@ -361,13 +387,19 @@ export class CdkCliIntegTestsWorkflow extends Component {
361387
'bin/run-suite --use-cli-release=${{ steps.versions.outputs.cli_version }} --framework-version=${{ steps.versions.outputs.lib_version }} ${{ matrix.suite }}',
362388
].join('\n'),
363389
env: {
364-
// Concurrency only for long-running cli-integ-tests
365-
JEST_TEST_CONCURRENT: "${{ matrix.suite == 'cli-integ-tests' && 'true' || 'false' }}",
366390
JSII_SILENCE_WARNING_DEPRECATED_NODE_VERSION: 'true',
367391
JSII_SILENCE_WARNING_UNTESTED_NODE_VERSION: 'true',
368392
JSII_SILENCE_WARNING_KNOWN_BROKEN_NODE_VERSION: 'true',
369393
DOCKERHUB_DISABLED: 'true',
370-
AWS_REGIONS: ['us-east-2', 'eu-west-1', 'eu-north-1', 'ap-northeast-1', 'ap-south-1'].join(','),
394+
...(props.enableAtmosphere ?
395+
{
396+
CDK_INTEG_ATMOSPHERE_ENABLED: 'true',
397+
CDK_INTEG_ATMOSPHERE_ENDPOINT: props.enableAtmosphere.endpoint,
398+
CDK_INTEG_ATMOSPHERE_POOL: props.enableAtmosphere.pool,
399+
} :
400+
{
401+
AWS_REGIONS: ['us-east-2', 'eu-west-1', 'eu-north-1', 'ap-northeast-1', 'ap-south-1'].join(','),
402+
}),
371403
CDK_MAJOR_VERSION: '2',
372404
RELEASE_TAG: 'latest',
373405
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}',

0 commit comments

Comments
 (0)