Skip to content

Commit ab67943

Browse files
chore(performance): Emit test results to stdout (#391)
This will make it easy to objectify PRs and their performance impact, as the contributor can copy-paste the result. It may also be useful to inject it onto a PR-triggered bot that pushes the results onto the PR as a comment. Co-authored-by: Vittorio Guerriero <[email protected]>
1 parent d49dcf1 commit ab67943

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

performance/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ const localRepository = LocalRepository(localFileData, 'performance.json');
1818
const data = addTestResultsToData(existingData, testResults, currentBranch, currentCommit);
1919

2020
await localRepository.update(data);
21+
22+
console.table(
23+
testResults.reduce((rows, { types, result }) => {
24+
rows[types] = Object.values(result)
25+
.map(({ title, value }) => ({ [title]: value }))
26+
.reduce((columns, col) => {
27+
return {
28+
...columns,
29+
...col,
30+
};
31+
}, {});
32+
33+
return rows;
34+
}, {}),
35+
);
2136
})();
2237

2338
function addTestResultsToData(data, results, currentBranch, currentCommit) {

0 commit comments

Comments
 (0)