Skip to content

Commit c91da48

Browse files
committed
fixup
1 parent 4c18193 commit c91da48

File tree

10 files changed

+294
-87
lines changed

10 files changed

+294
-87
lines changed

.projenrc.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,10 +1386,6 @@ for (const tsconfig of [cli.tsconfig, cli.tsconfigDev]) {
13861386
tsconfig?.addExclude('vendor/**/*');
13871387
}
13881388

1389-
// #endregion
1390-
//////////////////////////////////////////////////////////////////////
1391-
// #region @aws-cdk/cdk-cli-wrapper - REMOVED
1392-
// The cdk-cli-wrapper package has been removed. The toolkit-lib engine is now the only supported engine.
13931389
// #endregion
13941390
//////////////////////////////////////////////////////////////////////
13951391
// #region cdk

packages/@aws-cdk/integ-runner/lib/cli.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import * as path from 'path';
44
import * as chalk from 'chalk';
55
import * as workerpool from 'workerpool';
66
import * as logger from './logger';
7-
import type { EngineOptions } from './runner/engine';
87
import type { IntegTest, IntegTestInfo } from './runner/integration-tests';
98
import { IntegrationTests } from './runner/integration-tests';
10-
import { processUnstableFeatures } from './unstable-features';
9+
import { processUnstableFeatures, availableFeaturesDescription } from './unstable-features';
1110
import type { IntegRunnerMetrics, IntegTestWorkerConfig, DestructiveChange } from './workers';
1211
import { runSnapshotTests, runIntegrationTests } from './workers';
1312
import { watchIntegrationTest } from './workers/integ-watch-worker';
@@ -53,7 +52,7 @@ export function parseCliArgs(args: string[] = []) {
5352
})
5453
.option('app', { type: 'string', default: undefined, desc: 'The custom CLI command that will be used to run the test files. You can include {filePath} to specify where in the command the test file path should be inserted. Example: --app="python3.8 {filePath}".' })
5554
.option('test-regex', { type: 'array', desc: 'Detect integration test files matching this JavaScript regex pattern. If used multiple times, all files matching any one of the patterns are detected.', default: [] })
56-
.option('unstable', { type: 'array', desc: 'Opt-in to using unstable features. Currently no unstable features are available.', nargs: 1, default: [] })
55+
.option('unstable', { type: 'array', desc: `Opt-in to using unstable features. By using these flags you acknowledge that scope and API of unstable features may change without notice. Specify multiple times for each unstable feature you want to opt-in to. ${availableFeaturesDescription()}`, nargs: 1, default: [] })
5756
.strict()
5857
.parse(args);
5958

@@ -121,17 +120,16 @@ export async function main(args: string[]) {
121120
const options = parseCliArgs(args);
122121

123122
// Process unstable features and emit appropriate warnings
124-
processUnstableFeatures(options.unstable);
123+
options.unstable = processUnstableFeatures(options.unstable);
125124

126-
const engine = engineFromOptions();
127-
await run(options, engine);
125+
await run(options);
128126
} catch (err: any) {
129127
logger.error(err);
130128
throw err;
131129
}
132130
}
133131

134-
async function run(options: ReturnType<typeof parseCliArgs>, { engine }: EngineOptions) {
132+
async function run(options: ReturnType<typeof parseCliArgs>) {
135133
const testsFromArgs = await new IntegrationTests(path.resolve(options.directory)).fromCliOptions(options);
136134

137135
// List only prints the discovered tests
@@ -162,7 +160,6 @@ async function run(options: ReturnType<typeof parseCliArgs>, { engine }: EngineO
162160
failedSnapshots = await runSnapshotTests(pool, testsFromArgs, {
163161
retain: options.inspectFailures,
164162
verbose: options.verbose,
165-
engine,
166163
});
167164
for (const failure of failedSnapshots) {
168165
logger.warning(`Failed: ${failure.fileName}`);
@@ -186,7 +183,6 @@ async function run(options: ReturnType<typeof parseCliArgs>, { engine }: EngineO
186183
if (options.runUpdateOnFailed || options.force) {
187184
const { success, metrics } = await runIntegrationTests({
188185
pool,
189-
engine,
190186
tests: testsToRun,
191187
regions: options.testRegions,
192188
profiles: options.profiles,
@@ -212,7 +208,6 @@ async function run(options: ReturnType<typeof parseCliArgs>, { engine }: EngineO
212208
} else if (options.watch) {
213209
await watchIntegrationTest(pool, {
214210
watch: true,
215-
engine,
216211
verbosity: options.verbosity,
217212
...testsToRun[0],
218213
profile: options.profiles ? options.profiles[0] : undefined,
@@ -334,10 +329,6 @@ function configFromFile(fileName?: string): Record<string, any> {
334329
}
335330
}
336331

337-
function engineFromOptions(): Required<EngineOptions> {
338-
return { engine: 'toolkit-lib' };
339-
}
340-
341332
/**
342333
* Coerce function for yargs array options to support comma-separated values.
343334
* Yargs doesn't natively split `--option=a,b,c` into ['a', 'b', 'c'].

packages/@aws-cdk/integ-runner/lib/runner/engine.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
import type { IntegRunnerOptions } from './runner-base';
22
import { ToolkitLibRunnerEngine } from '../engines/toolkit-lib';
33

4-
/**
5-
* Engine options for the integ runner
6-
*
7-
* Note: The 'cli-wrapper' engine has been removed. Only 'toolkit-lib' is supported.
8-
*/
9-
export interface EngineOptions {
10-
/**
11-
* The CDK Toolkit engine to be used by the runner.
12-
*
13-
* @default "toolkit-lib"
14-
*/
15-
readonly engine?: 'toolkit-lib';
16-
}
17-
184
/**
195
* Creates the engine for running integration tests.
206
*

packages/@aws-cdk/integ-runner/lib/runner/runner-base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { IntegTestSuite, LegacyIntegTestSuite } from './integ-test-suite';
88
import type { IntegTest } from './integration-tests';
99
import * as recommendedFlagsFile from '../recommended-feature-flags.json';
1010
import { flatten } from '../utils';
11-
import { makeEngine, type EngineOptions } from './engine';
11+
import { makeEngine } from './engine';
1212
import type { ICdk } from '../engines/cdk-interface';
1313
import * as logger from '../logger';
1414
import type { ManifestTrace } from './private/cloud-assembly';
@@ -21,7 +21,7 @@ const DESTRUCTIVE_CHANGES = '!!DESTRUCTIVE_CHANGES:';
2121
/**
2222
* Options for creating an integration test runner
2323
*/
24-
export interface IntegRunnerOptions extends EngineOptions {
24+
export interface IntegRunnerOptions {
2525
/**
2626
* Information about the test to run
2727
*/

packages/@aws-cdk/integ-runner/lib/unstable-features.ts

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,80 +16,60 @@ export enum FeatureStatus {
1616
* Definition of an unstable feature
1717
*/
1818
export interface UnstableFeature {
19-
/** The feature name as passed to --unstable */
20-
readonly name: string;
2119
/** Current status of the feature */
2220
readonly status: FeatureStatus;
23-
/** Warning message to display when feature is used */
24-
readonly warningMessage: string;
25-
/** Optional: message to display for removed features */
26-
readonly removalMessage?: string;
27-
}
28-
29-
/**
30-
* Result of processing unstable features
31-
*/
32-
export interface ProcessedFeatures {
33-
/** Features that are valid and should be applied */
34-
readonly validFeatures: string[];
35-
/** Features that were ignored (removed or unknown) */
36-
readonly ignoredFeatures: string[];
21+
/** Warning message to display when requested feature is deprecated */
22+
readonly deprecationMessage: string;
23+
/** Message to display for requested features that are removed */
24+
readonly removalMessage: string;
3725
}
3826

3927
/**
4028
* Registry of all unstable features
4129
*/
42-
export const UNSTABLE_FEATURES: readonly UnstableFeature[] = [
43-
{
44-
name: 'deprecated-cli-engine',
30+
export const UNSTABLE_FEATURES: Record<string, UnstableFeature> = {
31+
'deprecated-cli-engine': {
4532
status: FeatureStatus.REMOVED,
46-
warningMessage: 'The deprecated-cli-engine option has been removed.',
47-
removalMessage: 'The cli-wrapper engine has been removed. The toolkit-lib engine is now the only supported engine.',
33+
deprecationMessage: 'You have opted-in to use the deprecated CLI engine which is scheduled to be removed in January 2026. If you have encountered blockers while using the new default engine, please let us know by opening an issue: https://github.com/aws/aws-cdk-cli/issues/new/choose\n\nTo use the new default engine, remove the `--unstable=deprecated-cli-engine` option.',
34+
removalMessage: 'The CLI engine has been removed. The toolkit-lib engine is now the only supported engine. Please remove this flag.',
4835
},
49-
{
50-
name: 'toolkit-lib-engine',
36+
'toolkit-lib-engine': {
5137
status: FeatureStatus.REMOVED,
52-
warningMessage: 'The toolkit-lib-engine option is no longer needed.',
38+
deprecationMessage: 'The toolkit-lib engine is now the default engine. This flag can be safely removed. You may choose to temporarily revert to the old engine by adding the `--unstable=deprecated-cli-engine` option.',
5339
removalMessage: 'The toolkit-lib engine is now the default and only engine. This flag can be safely removed.',
5440
},
55-
];
41+
};
5642

5743
/**
5844
* Process unstable feature flags and emit appropriate warnings
5945
*
60-
* @param features - Array of feature names from CLI --unstable option
61-
* @returns ProcessedFeatures with validFeatures and ignoredFeatures
46+
* @param unstableFeatures - Array of feature names from CLI --unstable option
47+
* @returns Array of valid, enabled feature names
6248
*/
63-
export function processUnstableFeatures(features: string[] | undefined | null): ProcessedFeatures {
49+
export function processUnstableFeatures(unstableFeatures: string[] = []): string[] {
6450
const validFeatures: string[] = [];
65-
const ignoredFeatures: string[] = [];
6651

67-
// Handle null/undefined input as empty array
68-
const featureList = features ?? [];
69-
70-
for (const featureName of featureList) {
71-
const feature = UNSTABLE_FEATURES.find(f => f.name === featureName);
52+
for (const featureName of unstableFeatures) {
53+
const feature = UNSTABLE_FEATURES[featureName];
7254

7355
if (!feature) {
7456
// Unknown feature - warn and ignore
7557
logger.warning(`Unknown unstable feature: '${featureName}'. This option will be ignored.`);
76-
ignoredFeatures.push(featureName);
7758
continue;
7859
}
7960

8061
switch (feature.status) {
8162
case FeatureStatus.REMOVED:
8263
// Removed feature - warn with removal message and ignore
83-
logger.warning(`[Removed] ${feature.warningMessage}`);
64+
logger.warning(`[Removed] ${feature.deprecationMessage}`);
8465
if (feature.removalMessage) {
8566
logger.warning(feature.removalMessage);
8667
}
87-
ignoredFeatures.push(featureName);
8868
break;
8969

9070
case FeatureStatus.DEPRECATED:
9171
// Deprecated feature - warn but still apply
92-
logger.warning(`[Deprecated] ${feature.warningMessage}`);
72+
logger.warning(`[Deprecated] ${feature.deprecationMessage}`);
9373
validFeatures.push(featureName);
9474
break;
9575

@@ -100,5 +80,22 @@ export function processUnstableFeatures(features: string[] | undefined | null):
10080
}
10181
}
10282

103-
return { validFeatures, ignoredFeatures };
83+
return validFeatures;
84+
}
85+
86+
/**
87+
* Returns a description of available unstable features for CLI help text
88+
*
89+
* @returns A string describing available features or indicating none are available
90+
*/
91+
export function availableFeaturesDescription(): string {
92+
const availableFeatures = Object.entries(UNSTABLE_FEATURES)
93+
.filter(([_, feature]) => feature.status === FeatureStatus.SUPPORTED)
94+
.map(([name]) => name);
95+
96+
if (availableFeatures.length === 0) {
97+
return 'Currently no unstable features are available.';
98+
}
99+
100+
return `Available features: ${availableFeatures.join(', ')}.`;
104101
}

packages/@aws-cdk/integ-runner/lib/workers/common.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { format } from 'util';
22
import type { ResourceImpact } from '@aws-cdk/cloudformation-diff';
33
import * as chalk from 'chalk';
44
import * as logger from '../logger';
5-
import type { EngineOptions } from '../runner/engine';
65
import type { IntegTestInfo } from '../runner/integration-tests';
76

87
/**
@@ -89,7 +88,7 @@ export interface IntegRunnerMetrics {
8988
readonly profile?: string;
9089
}
9190

92-
export interface SnapshotVerificationOptions extends EngineOptions {
91+
export interface SnapshotVerificationOptions {
9392
/**
9493
* Retain failed snapshot comparisons
9594
*
@@ -124,7 +123,7 @@ export interface IntegBatchResponse {
124123
/**
125124
* Common options for running integration tests
126125
*/
127-
export interface IntegTestOptions extends EngineOptions {
126+
export interface IntegTestOptions {
128127
/**
129128
* A list of integration tests to run
130129
* in this batch

packages/@aws-cdk/integ-runner/lib/workers/extract/extract_worker.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export async function integTestWorker(request: IntegTestBatchRequest): Promise<I
2828

2929
try {
3030
const runner = new IntegTestRunner({
31-
engine: request.engine,
3231
test,
3332
profile: request.profile,
3433
region: request.region,
@@ -96,7 +95,6 @@ export async function watchTestWorker(options: IntegWatchOptions): Promise<void>
9695
const verbosity = options.verbosity ?? 0;
9796
const test = new IntegTest(options);
9897
const runner = new IntegTestRunner({
99-
engine: options.engine,
10098
test,
10199
profile: options.profile,
102100
region: options.region,
@@ -141,7 +139,6 @@ export async function snapshotTestWorker(testInfo: IntegTestInfo, options: Snaps
141139

142140
try {
143141
const runner = new IntegSnapshotRunner({
144-
engine: options.engine,
145142
test,
146143
showOutput: options.verbose ?? false,
147144
});

packages/@aws-cdk/integ-runner/lib/workers/integ-test-worker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ export async function runIntegrationTestsInParallel(
136136
dryRun: options.dryRun,
137137
verbosity: options.verbosity,
138138
updateWorkflow: options.updateWorkflow,
139-
engine: options.engine,
140139
}], {
141140
on: printResults,
142141
});

packages/@aws-cdk/integ-runner/lib/workers/integ-watch-worker.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import type * as workerpool from 'workerpool';
22
import { printResults } from './common';
33
import type { IntegTestInfo } from '../runner';
4-
import type { EngineOptions } from '../runner/engine';
54

6-
export interface IntegWatchOptions extends IntegTestInfo, EngineOptions {
5+
export interface IntegWatchOptions extends IntegTestInfo {
76
readonly region: string;
87
readonly profile?: string;
98
readonly verbosity?: number;

0 commit comments

Comments
 (0)