From 481d8b79cc0ff70282367c7657ad308c3acd178e Mon Sep 17 00:00:00 2001 From: Otavio Macedo Date: Thu, 15 Jul 2021 18:02:21 +0100 Subject: [PATCH] chore(cli): tests that apply only to v1 are failing when building for v2 (#15565) In v1 we are allowing selection by the ID of the stack, with a warning that it will be stop working in v2 and asking the user to use the same names shown in the `cdk ls` result. Since the tests are written with the ID as input, they work when building for v1, but fail when building for v2. This change makes it work in both cases. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk/test/api/cloud-assembly.test.ts | 2 +- packages/aws-cdk/test/cdk-toolkit.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk/test/api/cloud-assembly.test.ts b/packages/aws-cdk/test/api/cloud-assembly.test.ts index 8ca66c9bad894..54d3a18f682ef 100644 --- a/packages/aws-cdk/test/api/cloud-assembly.test.ts +++ b/packages/aws-cdk/test/api/cloud-assembly.test.ts @@ -135,7 +135,7 @@ test('select behavior with nested assemblies: repeat', async() => { const cxasm = await testNestedCloudAssembly(); // WHEN - const x = await cxasm.selectStacks({ patterns: ['withouterrors', 'withouterrors', 'nested'] }, { + const x = await cxasm.selectStacks({ patterns: ['deeply/hidden/withouterrors', 'nested'] }, { defaultBehavior: DefaultSelection.AllStacks, }); diff --git a/packages/aws-cdk/test/cdk-toolkit.test.ts b/packages/aws-cdk/test/cdk-toolkit.test.ts index c2bd6c48206ca..8f53405b749e4 100644 --- a/packages/aws-cdk/test/cdk-toolkit.test.ts +++ b/packages/aws-cdk/test/cdk-toolkit.test.ts @@ -221,7 +221,7 @@ describe('synth', () => { const toolkit = defaultToolkitSetup(); - await expect(toolkit.synth(['witherrors'], false, true)).rejects.toBeDefined(); + await expect(toolkit.synth(['Test-Stack-A/witherrors'], false, true)).rejects.toBeDefined(); }); test('stack has error, is not flagged for validation and was not explicitly selected', async () => {