Skip to content

Commit 0c753c3

Browse files
authored
chore: fix failing notices integ test (#31625)
There were two problems: 1. The test compares against bootstrap stack version `22`. This will break once we bump the bootstrap stack version. Changed range to `<1999` to include all possible future versions. 2. The CLI and Framework notices are not displayed because in the pipeline, their version is suffixed with `-rc.1`, and apparently `semver` doesn't match against those. > `semver.satisfies('2.16.0-rc.0', '<99.0.0') // false` > `semver.satisfies('2.16.0', '<99.0.0') // true` I don't see a quick way around this so I just removed those notices from the test. We have plenty of unit tests to cover this so i'm not too concerned. Note that this means our notices mechanism isn't able to match against pre-releases, this had always been the case and is ok since we don't publish our pre-releases. ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent ba5a53d commit 0c753c3

File tree

1 file changed

+5
-44
lines changed

1 file changed

+5
-44
lines changed

packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,55 +2339,19 @@ integTest(
23392339
}),
23402340
);
23412341

2342-
integTest('cdk notices are displayed correctly', withDefaultFixture(async (fixture) => {
2342+
integTest('cdk bootstrap notice is displayed correctly', withDefaultFixture(async (fixture) => {
23432343

23442344
const cache = {
23452345
expiration: 4125963264000, // year 2100 so we never overwrite the cache
23462346
notices: [
23472347
{
2348-
title: 'CLI Notice',
2349-
issueNumber: 1111,
2350-
overview: 'Overview for CLI Notice',
2351-
components: [
2352-
{
2353-
name: 'cli',
2354-
version: '<99.0.0',
2355-
},
2356-
],
2357-
schemaVersion: '1',
2358-
},
2359-
{
2360-
title: 'Framework Notice',
2361-
issueNumber: 2222,
2362-
overview: 'Overview for Framework Notice',
2363-
components: [
2364-
{
2365-
name: 'framework',
2366-
version: '<99.0.0',
2367-
},
2368-
],
2369-
schemaVersion: '1',
2370-
},
2371-
{
2372-
title: 'Queue Notice',
2373-
issueNumber: 3333,
2374-
overview: 'Overview for Queue Notice',
2375-
components: [
2376-
{
2377-
name: 'aws-cdk-lib.aws_sqs.Queue',
2378-
version: '<99.0.0',
2379-
},
2380-
],
2381-
schemaVersion: '1',
2382-
},
2383-
{
2384-
title: 'Bootstrap 22 Notice',
2348+
title: 'Bootstrap 1999 Notice',
23852349
issueNumber: 4444,
2386-
overview: 'Overview for Bootstrap 22 Notice. AffectedEnvironments:<{resolve:ENVIRONMENTS}>',
2350+
overview: 'Overview for Bootstrap 1999 Notice. AffectedEnvironments:<{resolve:ENVIRONMENTS}>',
23872351
components: [
23882352
{
23892353
name: 'bootstrap',
2390-
version: '22',
2354+
version: '<1999', // so we include all possible environments
23912355
},
23922356
],
23932357
schemaVersion: '1',
@@ -2406,10 +2370,7 @@ integTest('cdk notices are displayed correctly', withDefaultFixture(async (fixtu
24062370
},
24072371
});
24082372

2409-
expect(output).toContain('Overview for CLI Notice');
2410-
expect(output).toContain('Overview for Framework Notice');
2411-
expect(output).toContain('Overview for Queue Notice');
2412-
expect(output).toContain('Overview for Bootstrap 22 Notice');
2373+
expect(output).toContain('Overview for Bootstrap 1999 Notice');
24132374

24142375
// assert dynamic environments are resolved
24152376
expect(output).toContain(`AffectedEnvironments:<aws://${await fixture.aws.account()}/${fixture.aws.region}>`);

0 commit comments

Comments
 (0)