mattermost-desktop/e2e/utils/pr-e2e-durations-report.js
aaron 057377207a
Some checks failed
release / begin-notification (push) Has been cancelled
release / build-linux (push) Has been cancelled
release / build-msi-installer (push) Has been cancelled
release / build-mac-installer (push) Has been cancelled
release / upload-to-s3 (push) Has been cancelled
release / github-release (push) Has been cancelled
release / end-notification (push) Has been cancelled
first commit bois
2024-10-03 06:35:14 -07:00

37 lines
779 B
JavaScript

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
function generateCommentBodyPerformanceTest(fileContents) {
const data = JSON.parse(fileContents);
return `
E2E Performance Test results:
| Test | Duration |
| --- | --- |
${data?.passes?.reduce((acc, pass) => {
return `${acc}| ${pass.fullTitle || 'title'} | ${pass.duration}ms |\n`;
}, '')
}
${data?.failures?.length > 0 ? `
Some tests failed:
| Test | Duration |
| --- | --- |
${data.failures.forEach((failure) => `| ${failure.fullTitle} | ${failure.duration}`)}
` : ''}
<details>
<summary>Raw results</summary>
\`\`\`js
${fileContents}
\`\`\`
</details>
`;
}
module.exports = {
generateCommentBodyPerformanceTest,
};