Skip to content

cdk-build-tools: testFutureBehavior/testLegacyBehavior outdated for CDK v2 #20890

@jumic

Description

@jumic

Describe the bug

Methods testFutureBehavior and testLegacyBehavior were modified for CDK v2 development:

  • testFutureBehavior ignores feature flags in CDK v2 because all feature flags are enabled by default
  • Tests in testLegacyBehavior will be ignored because there is no legacy behavior when CDK v2 was released

This logic was correct during the development of CDK v2. Now, it must be possible to add new feature flags.

Instead of checking for version 2 in the following line, we need to change it to version 3:

Expected Behavior

  • testFutureBehavior supports new feature flags
  • testLegacyBehavior executes tests without feature flag

Current Behavior

  • testFutureBehavior doesn't support adding feature flags
  • Tests in testLegacyBehavior will be skipped

Reproduction Steps

Test cases in PR #18140 fail because testFutureBehavior doesn't execute the correct behavior after target branch of this PR was changed to v2 main branch.

Possible Solution

Replace version 2 by 3 in the following lines:

Additional Information/Context

No response

CDK CLI Version

2.29.0

Framework Version

No response

Node.js Version

v16.15.1

OS

MacOS

Language

Typescript

Language Version

No response

Other information

I can create a PR to fix this issue. Please let me know if the proposed solution is correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    aws-cdk-libRelated to the aws-cdk-lib packagebugThis issue is a bug.effort/mediumMedium work item – several days of effortp1package/toolsRelated to AWS CDK Tools or CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions