Skip to content

Commit 460836a

Browse files
author
Elad Ben-Israel
authored
chore: fix new ecs test to use v2 asset style (#18849)
The test "expose image name" makes an assertion about the asset image location, which differs between v1 and v2. Use `testFutureBehavior` to force it to use the v2 asset style. This unblocks the forward merge between v1 and v2 (#18763). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent c4126cc commit 460836a

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

packages/@aws-cdk/aws-ecs/test/container-definition.test.ts

+3-13
Original file line numberDiff line numberDiff line change
@@ -2006,9 +2006,9 @@ describe('container definition', () => {
20062006

20072007
});
20082008

2009-
test('exposes image name', () => {
2009+
testFutureBehavior('exposes image name', { '@aws-cdk/core:newStyleStackSynthesis': true }, cdk.App, (app) => {
20102010
// GIVEN
2011-
const stack = new cdk.Stack();
2011+
const stack = new cdk.Stack(app, 'MyStack');
20122012
const taskDefinition = new ecs.FargateTaskDefinition(stack, 'TaskDef');
20132013

20142014
// WHEN
@@ -2018,17 +2018,7 @@ describe('container definition', () => {
20182018

20192019
// THEN
20202020
expect(stack.resolve(container.imageName)).toEqual({
2021-
'Fn::Join': [
2022-
'',
2023-
[
2024-
{ Ref: 'AWS::AccountId' },
2025-
'.dkr.ecr.',
2026-
{ Ref: 'AWS::Region' },
2027-
'.',
2028-
{ Ref: 'AWS::URLSuffix' },
2029-
'/aws-cdk/assets:baa2d6eb2a17c75424df631c8c70ff39f2d5f3bee8b9e1a109ee24ca17300540',
2030-
],
2031-
],
2021+
'Fn::Sub': '${AWS::AccountId}.dkr.ecr.${AWS::Region}.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-${AWS::AccountId}-${AWS::Region}:baa2d6eb2a17c75424df631c8c70ff39f2d5f3bee8b9e1a109ee24ca17300540',
20322022
});
20332023
});
20342024
});

0 commit comments

Comments
 (0)