From 576a851d27a1c4494a88bd454fefc66d54f6261e Mon Sep 17 00:00:00 2001 From: "k.goto" <24818752+go-to-k@users.noreply.github.com> Date: Tue, 18 Jul 2023 22:05:08 +0900 Subject: [PATCH] chore(integ-tests-alpha): integ tests link is incorrect (#26402) This PR corrects integ tests link in an integ-runner doc and an error message. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/integ-runner/README.md | 2 +- .../integ-runner/lib/runner/integ-test-runner.ts | 4 ++-- .../test/runner/integ-test-runner.test.ts | 14 ++++++++++++++ .../test/test-data/xxxxx.test-with-error.ts | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 packages/@aws-cdk/integ-runner/test/test-data/xxxxx.test-with-error.ts diff --git a/packages/@aws-cdk/integ-runner/README.md b/packages/@aws-cdk/integ-runner/README.md index e38f23f393b38..0d3b989d31cb1 100644 --- a/packages/@aws-cdk/integ-runner/README.md +++ b/packages/@aws-cdk/integ-runner/README.md @@ -25,7 +25,7 @@ publishing this tool so that it can be used by the community and we would love t on use cases that the tool should support, or issues that prevent the tool from being used in your library. -This tool is meant to be used with the [integ-tests](https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests) library. +This tool is meant to be used with the [integ-tests](https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha) library. ## Usage diff --git a/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts b/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts index d25293036c906..0722d4cc8449b 100644 --- a/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts +++ b/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts @@ -77,8 +77,8 @@ export class IntegTestRunner extends IntegRunner { // test then point the user to the new `IntegTest` construct if (!this.hasSnapshot() && this.isLegacyTest) { throw new Error(`${this.testName} is a new test. Please use the IntegTest construct ` + - 'to configure the test\n' + - 'https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests', + 'to configure the test\n' + + 'https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha', ); } } diff --git a/packages/@aws-cdk/integ-runner/test/runner/integ-test-runner.test.ts b/packages/@aws-cdk/integ-runner/test/runner/integ-test-runner.test.ts index 3e85a14be0db2..b9831ef7a65f8 100644 --- a/packages/@aws-cdk/integ-runner/test/runner/integ-test-runner.test.ts +++ b/packages/@aws-cdk/integ-runner/test/runner/integ-test-runner.test.ts @@ -675,4 +675,18 @@ describe('IntegTest watchIntegTest', () => { verbose: undefined, })); }); + + test('with error', () => { + expect(() => { + // WHEN + new IntegTestRunner({ + cdk: cdkMock.cdk, + test: new IntegTest({ + fileName: 'test/test-data/xxxxx.test-with-error.js', + discoveryRoot: 'test/test-data', + }), + }); + // THEN + }).toThrowError('xxxxx.test-with-error is a new test. Please use the IntegTest construct to configure the test\nhttps://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha'); + }); }); diff --git a/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.test-with-error.ts b/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.test-with-error.ts new file mode 100644 index 0000000000000..e43a408f7b31c --- /dev/null +++ b/packages/@aws-cdk/integ-runner/test/test-data/xxxxx.test-with-error.ts @@ -0,0 +1 @@ +/// !cdk-integ test-stack