@aws-cdk/integ-runner: Running tests makes runner think a deprecated feature flag is active for test stacks
See original GitHub issueDescribe the bug
When invoking integ-runner
to run a test file with an IntegTest
, it always errors out with Error: Unsupported feature flag '@aws-cdk/core:enableStackNameDuplicates'. This flag existed on CDKv1 but has been removed in CDKv2. CDK will now behave as the same as when the flag is enabled.
This happened with both an existing CDK project and a new one created with cdk init --language typescript
using CDKv2. This flag was not defined in project initialization nor at any point after.
Expected Behavior
- Invoke
integ-runner
to run a test file - Test stacks get deployed and tests run
Current Behavior
integ-runner
errors out withError: Unsupported feature flag '@aws-cdk/core:enableStackNameDuplicates'. This flag existed on CDKv1 but has been removed in CDKv2. CDK will now behave as the same as when the flag is enabled.
- Tests are not run
Reproduction Steps
- Install cdk:
npm i -g cdk
- Create a new cdk project:
cdk init --language typescript
- Install
integ-tests-alpha
:npm i @aws-cdk/integ-tests-alpha@2.33.0-alpha.0
- Install
integ-runner
:npm i -g @aws-cdk/integ-runner@1.165.0
- Create a file
test/integ.test.js
with the following contents:
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
class StackUnderTest extends Stack {
constructor(scope, id, props) {
super(scope, id, props);
}
}
// Beginning of the test suite
const app = new App();
new IntegTest(app, 'MyTestCase', {
testCases: [
new StackUnderTest(app, 'Stack1', { }),
],
});
- Run
integ-runner --update-on-failed
(I useaws-vault
to run in a sandbox account, so my full command isaws-vault exec <profile> -- integ-runner --update-on-failed
)
Possible Solution
No response
Additional Information/Context
A coworker followed a similar flow and ran into the same issue. We aren’t sure if we’re overlooking something or doing something wrong but we haven’t been able to make sense of why we’re running into this issue.
CDK CLI Version
2.31.2 (build 091f0d8)
Framework Version
No response
Node.js Version
v16.9.1
OS
macOS Monterey 12.4
Language
Typescript
Language Version
3.9.10
Other information
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:8 (7 by maintainers)
I ran into the same problem and did debugged this issue. Perhaps this is due to the fact that integ-runner is v1. I found following code in the
integ-runner
.This code appears to remove expired future flags in v2. running it in v2 produces the expected values.
However, in practice, the following values are obtained because the constants defined in v1 are used.
Integ-runner uses this context to synthesize the stack, which causes an
Error: Unsupported feature flag '@aws-cdk/core:enableStackNameDuplicates'. This flag existed on CDKv1 but has been removed in CDKv2. CDK will now behave as the same as when the flag is enabled.
error in v2.@madeline-k Is it possible to release
integ-runner-alpha
in v2?@orlandronen1 @WinterYukky @dontirun can you try this now? We are now publishing integ-runner for v2. https://www.npmjs.com/package/@aws-cdk/integ-runner/v/2.44.0