Skip to content

Commit 4e58e28

Browse files
committed
fixup! test: catch and log all errors include test setup
1 parent a054fa1 commit 4e58e28

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

tests/legacy-cli/e2e_runner.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -175,22 +175,13 @@ Promise.all([findFreePort(), findFreePort()])
175175
await runSteps(runSetup, allSetups, 'setup');
176176
await runSteps(runInitializer, allInitializers, 'initializer');
177177
await runSteps(runTest, testsToRun, 'test');
178-
} finally {
179-
registryProcess.kill();
180-
secureRegistryProcess.kill();
181-
}
182-
})
183-
.then(
184-
() => {
178+
185179
if (shardId !== null) {
186180
console.log(colors.green(`Done shard ${shardId} of ${nbShards}.`));
187181
} else {
188182
console.log(colors.green('Done.'));
189183
}
190-
191-
process.exit(0);
192-
},
193-
(err) => {
184+
} catch (err) {
194185
if (err instanceof Error) {
195186
console.log('\n');
196187
console.error(colors.red(err.message));
@@ -211,9 +202,16 @@ Promise.all([findFreePort(), findFreePort()])
211202
}
212203
}
213204

214-
process.exit(1);
215-
},
216-
);
205+
process.exitCode = 1;
206+
} finally {
207+
registryProcess.kill();
208+
secureRegistryProcess.kill();
209+
}
210+
})
211+
.catch((err) => {
212+
console.error(colors.red(`Unkown Error: ${err}`));
213+
process.exitCode = 1;
214+
});
217215

218216
async function runSteps(
219217
run: (name: string) => Promise<void> | void,

0 commit comments

Comments
 (0)