-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
bugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1
Description
What is the problem?
See:
aws-cdk/packages/@aws-cdk/aws-applicationautoscaling/test/scalable-target.test.ts
Lines 98 to 102 in a349666
| expect(target.node.metadataEntry).toEqual([{ | |
| type: 'aws:cdk:warning', | |
| data: 'cron: If you don\'t pass \'minute\', by default the event runs every minute. Pass \'minute: \'*\'\' if that\'s what you intend, or \'minute: 0\' to run once per hour instead.', | |
| trace: undefined, | |
| }]); |
And many more places in the CDK. The problem is that they assert on a specific node.metadataentry, but if we ever add a different message to the node metadata, this test will fail.
This happens many times when we add warnings around the CDK, see #19464.
Reproduction Steps
see linked file.
What did you expect to happen?
These tests should be changed to:
Annotations.fromStack(stack).hasWarning('/Path/To/Node', 'warning message');also:
Annotations.fromStack(stack).hasNoWarning('/Path/To/Node', 'warning message');This will be more robust as it does not depend on the existence/non-existence of other messages on the node.
What actually happened?
Possible failing tests in the future.
CDK CLI Version
latest
Framework Version
No response
Node.js Version
latest
OS
Mac
Language
Typescript
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1