Skip to content

Commit 4b2635a

Browse files
committed
test: catch and log all errors include test setup
1 parent 3be0f5f commit 4b2635a

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

tests/legacy-cli/e2e_runner.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,22 @@ Promise.all([findFreePort(), findFreePort()])
175175
await runSteps(runSetup, allSetups, 'setup');
176176
await runSteps(runInitializer, allInitializers, 'initializer');
177177
await runSteps(runTest, testsToRun, 'test');
178-
178+
} finally {
179+
registryProcess.kill();
180+
secureRegistryProcess.kill();
181+
}
182+
})
183+
.then(
184+
() => {
179185
if (shardId !== null) {
180186
console.log(colors.green(`Done shard ${shardId} of ${nbShards}.`));
181187
} else {
182188
console.log(colors.green('Done.'));
183189
}
184-
} catch (err) {
190+
191+
process.exit(0);
192+
},
193+
(err) => {
185194
if (err instanceof Error) {
186195
console.log('\n');
187196
console.error(colors.red(err.message));
@@ -202,15 +211,8 @@ Promise.all([findFreePort(), findFreePort()])
202211
}
203212
}
204213

205-
throw err;
206-
} finally {
207-
registryProcess.kill();
208-
secureRegistryProcess.kill();
209-
}
210-
})
211-
.then(
212-
() => process.exit(0),
213-
() => process.exit(1),
214+
process.exit(1);
215+
},
214216
);
215217

216218
async function runSteps(

0 commit comments

Comments
 (0)