From d110bce978470bab000276234f45c1feb383ffdc Mon Sep 17 00:00:00 2001 From: karakter98 <37190268+karakter98@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:54:06 +0300 Subject: [PATCH] Fixed existing integration test that worked when executed as a .js compiled file, but broke if run with ts-node directly. --- .../aws-events-targets/test/aws-api/integ.aws-api.ts | 7 ++++--- packages/@aws-cdk/integ-runner/README.md | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.ts b/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.ts index 9dc135dfef993..495361a19be2e 100644 --- a/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.ts +++ b/packages/@aws-cdk/aws-events-targets/test/aws-api/integ.aws-api.ts @@ -1,5 +1,6 @@ import * as events from '@aws-cdk/aws-events'; import * as cdk from '@aws-cdk/core'; +import { ECS, RDS } from 'aws-sdk'; import * as targets from '../../lib'; const app = new cdk.App(); @@ -22,7 +23,7 @@ class AwsApi extends cdk.Stack { parameters: { service: 'cool-service', forceNewDeployment: true, - } as AWS.ECS.UpdateServiceRequest, + } as ECS.UpdateServiceRequest, })); scheduleRule.addTarget(new targets.AwsApi({ @@ -30,7 +31,7 @@ class AwsApi extends cdk.Stack { action: 'stopDBInstance', parameters: { DBInstanceIdentifier: 'dev-instance', - } as AWS.RDS.StopDBInstanceMessage, + } as RDS.StopDBInstanceMessage, })); // Create snapshots when a DB instance restarts @@ -48,7 +49,7 @@ class AwsApi extends cdk.Stack { action: 'createDBSnapshot', parameters: { DBInstanceIdentifier: events.EventField.fromPath('$.detail.SourceArn'), - } as AWS.RDS.CreateDBSnapshotMessage, + } as RDS.CreateDBSnapshotMessage, })); } } diff --git a/packages/@aws-cdk/integ-runner/README.md b/packages/@aws-cdk/integ-runner/README.md index 94a281e46486c..4cddd5dafdf27 100644 --- a/packages/@aws-cdk/integ-runner/README.md +++ b/packages/@aws-cdk/integ-runner/README.md @@ -68,8 +68,12 @@ to be a self contained CDK app. The runner will execute the following for each f Read the list of tests from this file - `--disable-update-workflow` (default=`false`) If this is set to `true` then the [update workflow](#update-workflow) will be disabled -- `--test-run-command` (default=`node`) - The command used by the test runner to synth the test files. This will depend on the language the tests are written in. For example, if the tests are written in Python, you could set this parameter to 'python', 'python3' or 'python3.8'. +- `--app` + The command used by the test runner to synth the test files. Uses default run commands based on the language the test is written in. You can use {filePath} in the command to specify where the test file name should be inserted in the command. Example: `--app "python3.8 {filePath}"` +- `--language` (default=`['csharp', 'fsharp', 'go', 'java', 'javascript', 'python', 'typescript']`) + The list of languages to discover tests for. Defaults to all CDK-supported languages. Example: `--language python --language typescript` +- `--test-regex` + A custom pattern in the JS RegExp format to match integration test file prefixes. Defaults are set based on naming conventions for the language the test is written in. Example: `--test-regex "^Integ\."` Example: