Skip to content

Commit a76c583

Browse files
author
ci-bot
committed
add runtime report
1 parent e06f339 commit a76c583

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ jobs:
477477
post-failed-report:
478478
docker:
479479
- image: cimg/node:20.19.0-browsers
480-
resource_class: << pipeline.parameters.resource_class >>
480+
resource_class: small
481481
working_directory: ~/remix-project
482482
steps:
483483
- checkout

scripts/post-pr-report.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,29 @@ if (!CIRCLE_TOKEN) exit('CIRCLECI_TOKEN missing');
3737
if (!HAS_APP_CREDS && !GH_TOKEN) exit('Missing GitHub auth: set GH_PR_COMMENT_TOKEN or APP_ID/INSTALLATION_ID/APP_PRIVATE_KEY');
3838
if (!SLUG || !JOB_NUM) exit('Missing CircleCI env (slug or job number)');
3939

40-
const summaryPath = path.join(OUTDIR, 'summary.json');
40+
const summaryPath = path.join(OUTDIR, 'summary.json');
4141
if (!fs.existsSync(summaryPath)) {
4242
log('summary.json not found; no failures or generator did not run. Skipping.');
4343
process.exit(0);
4444
}
4545

46+
function formatRunTime() {
47+
const now = new Date();
48+
return now.toLocaleString('en-US', {
49+
weekday: 'short',
50+
year: 'numeric',
51+
month: 'short',
52+
day: 'numeric',
53+
hour: '2-digit',
54+
minute: '2-digit',
55+
timeZoneName: 'short'
56+
});
57+
}
58+
4659
(async () => {
4760
const summary = JSON.parse(fs.readFileSync(summaryPath, 'utf8'));
4861
const failures = Array.isArray(summary.failures) ? summary.failures : [];
62+
const runTime = formatRunTime();
4963

5064
const { owner, repo } = parseSlug(SLUG);
5165
const prNumber = await resolvePrNumber(owner, repo, PR_URLS, SHA);
@@ -65,6 +79,8 @@ if (!fs.existsSync(summaryPath)) {
6579
MARKER,
6680
`✅ E2E tests passed (workflow: ${escapeMd(summary.workflowName || '')})`,
6781
'',
82+
`_Last run: ${runTime}_`,
83+
'',
6884
'_All tests are now passing! Previous failures have been resolved._'
6985
].join('\n');
7086
await gh(`PATCH /repos/${owner}/${repo}/issues/comments/${mine.id}`, { body: successBody });
@@ -98,6 +114,8 @@ if (!fs.existsSync(summaryPath)) {
98114
MARKER,
99115
`❌ E2E failures detected (workflow: ${escapeMd(summary.workflowName || '')})`,
100116
'',
117+
`_Last run: ${runTime}_`,
118+
'',
101119
`[View HTML report](${indexUrl})`,
102120
'',
103121
`Top failing tests (${top.length}/${failures.length}):`,

0 commit comments

Comments
 (0)