cli: move repot test result processing to runner, and by path

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-10-08 00:14:53 +02:00
parent 86d6c1d2bf
commit 25943ab18b
2 changed files with 40 additions and 25 deletions
@@ -16,25 +16,8 @@
module.exports = async results => {
const cache = global.__backstageCli_jestSuccessCache;
if (!cache) {
return results;
if (cache) {
await cache.reportResults(results);
}
const successful = new Set();
const failed = new Set();
for (const testResult of results.testResults) {
const projectName = testResult.displayName.name;
if (testResult.numFailingTests > 0) {
failed.add(projectName);
successful.delete(projectName);
} else if (!failed.has(projectName)) {
successful.add(projectName);
}
}
await cache.reportResults({
successful: successful,
});
return results;
};