Skip to content

Commit

Permalink
Fixed existing integration test that worked when executed as a .js co…
Browse files Browse the repository at this point in the history
…mpiled file, but broke if run with ts-node directly.
  • Loading branch information
karakter98 committed Oct 18, 2022
1 parent 4d21159 commit d110bce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -22,15 +23,15 @@ class AwsApi extends cdk.Stack {
parameters: {
service: 'cool-service',
forceNewDeployment: true,
} as AWS.ECS.UpdateServiceRequest,
} as ECS.UpdateServiceRequest,
}));

scheduleRule.addTarget(new targets.AwsApi({
service: 'RDS',
action: 'stopDBInstance',
parameters: {
DBInstanceIdentifier: 'dev-instance',
} as AWS.RDS.StopDBInstanceMessage,
} as RDS.StopDBInstanceMessage,
}));

// Create snapshots when a DB instance restarts
Expand All @@ -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,
}));
}
}
Expand Down
8 changes: 6 additions & 2 deletions packages/@aws-cdk/integ-runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit d110bce

Please sign in to comment.