Skip to content

Commit 7a7e444

Browse files
committed
Improve test run end in case of testsuite crash
1 parent 43df949 commit 7a7e444

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

integration/vscode/ada/src/e3Testsuite.ts

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,17 +256,32 @@ export function activateE3TestsuiteIntegration(context: vscode.ExtensionContext)
256256
if (code === 0) {
257257
resolve();
258258
} else {
259-
reject(Error(''));
259+
const md = new vscode.MarkdownString(
260+
`Test run failed, see ` +
261+
`[Output](command:testing.showMostRecentOutput)`,
262+
);
263+
md.isTrusted = true;
264+
const msg = new vscode.TestMessage(md);
265+
remainingSet.forEach((t) => run.errored(t, msg));
266+
run.end();
267+
reject(
268+
Error('Test run failed, see Test Results view for testsuite output.'),
269+
);
260270
}
261271
});
262-
});
263-
264-
if (!enableEventSystem) {
265-
const e3ResultsPath = path.join(cwd, 'out', 'new');
266-
processTestsuiteResultIndex(e3ResultsPath, run);
267-
}
268-
269-
run.end();
272+
})
273+
.then(() => {
274+
if (!enableEventSystem) {
275+
const e3ResultsPath = path.join(cwd, 'out', 'new');
276+
processTestsuiteResultIndex(e3ResultsPath, run);
277+
}
278+
})
279+
.finally(() => {
280+
/**
281+
* Always end the run, be it a nominal or an error end.
282+
*/
283+
run.end();
284+
});
270285
},
271286
);
272287

0 commit comments

Comments
 (0)