Skip to content

Commit 6a8511d

Browse files
committed
test: don't run git clean on test failure
This allows debugging the test failures when running in debug mode. (cherry picked from commit e8e9df875722d23bbfd11c70ad17c492353976ce)
1 parent 1229dfb commit 6a8511d

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

tests/legacy-cli/e2e_runner.ts

+7-15
Original file line numberDiff line numberDiff line change
@@ -250,37 +250,29 @@ async function runSteps(
250250
}
251251
}
252252

253-
async function runSetup(absoluteName: string) {
253+
function runSetup(absoluteName: string): Promise<void> {
254254
const module = require(absoluteName);
255255

256-
await (typeof module === 'function' ? module : module.default)();
256+
return (typeof module === 'function' ? module : module.default)();
257257
}
258258

259259
/**
260260
* Run a file from the projects root directory in a subprocess via launchTestProcess().
261261
*/
262-
async function runInitializer(absoluteName: string) {
262+
function runInitializer(absoluteName: string): Promise<void> {
263263
process.chdir(getGlobalVariable('projects-root'));
264264

265-
await launchTestProcess(absoluteName);
265+
return launchTestProcess(absoluteName);
266266
}
267267

268268
/**
269269
* Run a file from the main 'test-project' directory in a subprocess via launchTestProcess().
270270
*/
271-
async function runTest(absoluteName: string) {
271+
async function runTest(absoluteName: string): Promise<void> {
272272
process.chdir(join(getGlobalVariable('projects-root'), 'test-project'));
273273

274-
try {
275-
await launchTestProcess(absoluteName);
276-
} finally {
277-
logStack.push(new logging.NullLogger());
278-
try {
279-
await gitClean();
280-
} finally {
281-
logStack.pop();
282-
}
283-
}
274+
await launchTestProcess(absoluteName);
275+
await gitClean();
284276
}
285277

286278
function printHeader(

0 commit comments

Comments
 (0)