Skip to content

Commit c274c2f

Browse files
authored
fix(integ-runner): don't throw error if tests pass (#20511)
If you run `integ-runner --update-on-failed` and the test succeeds, then the cli should not return an exit code. re #20384 ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 7779531 commit c274c2f

File tree

1 file changed

+7
-2
lines changed
  • packages/@aws-cdk/integ-runner/lib

1 file changed

+7
-2
lines changed

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

+7-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ async function main() {
4949

5050
let failedSnapshots: IntegTestWorkerConfig[] = [];
5151
if (argv['max-workers'] < testRegions.length * (profiles ?? [1]).length) {
52-
logger.warning('You are attempting to run %s tests in parallel, but only have %s workers. Not all of your profiles+regions will be utilized', argv.profiles*argv['parallel-regions'], argv['max-workers']);
52+
logger.warning('You are attempting to run %s tests in parallel, but only have %s workers. Not all of your profiles+regions will be utilized', argv.profiles * argv['parallel-regions'], argv['max-workers']);
5353
}
5454

55+
let testsSucceeded = false;
5556
try {
5657
if (argv.list) {
5758
const tests = await new IntegrationTests(argv.directory).fromCliArgs();
@@ -99,6 +100,8 @@ async function main() {
99100
verbose: argv.verbose,
100101
updateWorkflow: !argv['disable-update-workflow'],
101102
});
103+
testsSucceeded = success;
104+
102105

103106
if (argv.clean === false) {
104107
logger.warning('Not cleaning up stacks since "--no-clean" was used');
@@ -125,7 +128,9 @@ async function main() {
125128
if (!runUpdateOnFailed) {
126129
message = 'To re-run failed tests run: yarn integ-runner --update-on-failed';
127130
}
128-
throw new Error(`Some snapshot tests failed!\n${message}`);
131+
if (!testsSucceeded) {
132+
throw new Error(`Some tests failed!\n${message}`);
133+
}
129134
}
130135

131136
}

0 commit comments

Comments
 (0)