Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(integ-runner): don't throw error if tests pass #20511

Merged
merged 4 commits into from
May 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/@aws-cdk/integ-runner/lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ async function main() {

let failedSnapshots: IntegTestWorkerConfig[] = [];
if (argv['max-workers'] < testRegions.length * (profiles ?? [1]).length) {
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']);
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']);
}

let testsSucceeded = false;
try {
if (argv.list) {
const tests = await new IntegrationTests(argv.directory).fromCliArgs();
Expand Down Expand Up @@ -99,6 +100,8 @@ async function main() {
verbose: argv.verbose,
updateWorkflow: !argv['disable-update-workflow'],
});
testsSucceeded = success;


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

}
Expand Down