Skip to content

feat(ci): log test resource metrics#17266

Open
Hona wants to merge 1 commit intoanomalyco:devfrom
Hona:feat/test-metrics-summary
Open

feat(ci): log test resource metrics#17266
Hona wants to merge 1 commit intoanomalyco:devfrom
Hona:feat/test-metrics-summary

Conversation

@Hona
Copy link
Member

@Hona Hona commented Mar 13, 2026

Summary

  • add a reusable Bun metrics wrapper that samples CPU, memory, and disk usage while a test command runs and prints a clear pass/fail summary
  • run unit and app e2e jobs through the wrapper in the test workflow so resource metrics show up directly in CI logs and the GitHub step summary
  • add local entrypoints for test:unit:metrics and test:e2e:local:metrics so the same instrumentation can be used outside CI

Validation

  • bun turbo typecheck
  • bun run test:unit:metrics
  • bun script/metrics.ts --name smoke --out tmp/metrics/smoke.json -- bun --version
  • bun script/metrics.ts --name fail --out tmp/metrics/fail.json -- bun -e "process.exit(1)"
  • bun run test:e2e:local:metrics (wrapper worked and printed metrics; the wrapped e2e run still had 2 failing tests on this machine)

Copilot AI review requested due to automatic review settings March 13, 2026 00:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a reusable Bun-based metrics wrapper (script/metrics.ts) that samples CPU, memory, and disk I/O while running a command, then outputs a summary to the console and GitHub step summary. The CI test workflow is updated to run tests through this wrapper.

Changes:

  • New script/metrics.ts that spawns a child command, collects resource samples at a configurable interval, and writes JSON + markdown summary
  • CI workflow (test.yml) wraps unit and e2e test steps with the metrics script
  • Root package.json adds test:unit:metrics and test:e2e:local:metrics convenience scripts

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
script/metrics.ts New metrics collection wrapper supporting CPU, memory, and disk (Linux/Windows) sampling
.github/workflows/test.yml Wraps unit and e2e test commands with the metrics script
package.json Adds local convenience scripts for running tests with metrics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const proc = Bun.spawn(args, {
cwd,
stdout: "pipe",
stderr: "pipe",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants