Skip to content

Commit

Permalink
chore: make the 'constructs' version used in the e2e-tests configurable
Browse files Browse the repository at this point in the history
The monocdk packages in the V2 branch were
[recently switched](aws#12054)
to using constructs in version 10.0.0-pre.5.
However, our e2e-tests always
[install the latest constructs](https://github.com/aws/aws-cdk/blob/12868a2ac9c7016e47633045fb0c00be7eeb5092/packages/aws-cdk/test/integ/helpers/cdk.ts#L124),
which is 3.2.108 currently, as pre-release versions are not considered when installing the latest
(and if they were, that would break the tests on the 'master' branch anyway).

Make the version of 'constructs' used configurable through an environment variable.
We will then need to update the tests in the v2 branch to set that to 10.0.0-pre.5.
  • Loading branch information
skinny85 committed Jan 19, 2021
1 parent 12868a2 commit 18f482d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/aws-cdk/test/integ/helpers/cdk.ts
Expand Up @@ -11,6 +11,7 @@ const REGIONS = process.env.AWS_REGIONS
: [process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION ?? 'us-east-1'];

const FRAMEWORK_VERSION = process.env.FRAMEWORK_VERSION;
const CONSTRUCTS_VERSION = process.env.CONSTRUCTS_VERSION;

process.stdout.write(`Using regions: ${REGIONS}\n`);
process.stdout.write(`Using framework version: ${FRAMEWORK_VERSION}\n`);
Expand Down Expand Up @@ -117,11 +118,9 @@ export function withMonolithicCfnIncludeCdkApp<A extends TestContext>(block: (co

let success = true;
try {
let module = uberPackage;
if (FRAMEWORK_VERSION) {
module = `${module}@${FRAMEWORK_VERSION}`;
}
await fixture.shell(['npm', 'install', 'constructs', module]);
const module = FRAMEWORK_VERSION ? `${uberPackage}@${FRAMEWORK_VERSION}` : uberPackage;
const constructs = CONSTRUCTS_VERSION ? `constructs@${CONSTRUCTS_VERSION}` : 'constructs';
await fixture.shell(['npm', 'install', constructs, module]);

await block(fixture);
} catch (e) {
Expand Down

0 comments on commit 18f482d

Please sign in to comment.