test(B-0156): add bun test for tools/profile.ts CLI dispatch#3962
test(B-0156): add bun test for tools/profile.ts CLI dispatch#3962AceHack wants to merge 2 commits into
Conversation
Closes one acceptance bullet for B-0156: "Each TS sibling has at least one `bun test` covering its primary entry path." This is the 4th of 6 non-install .sh-port targets to get test coverage (amara and ani are covered by peer-call/smoke.test.ts; snapshot / check-drift / check-shard-schema and tools/profile.ts had no dedicated tests). Scope: 8 tests covering help / unknown-command / missing-arg paths that exit early — no external `dotnet-counters` / `dotnet-trace` / `dotnet-gcdump` invocations. Mirrors the established peer-call/smoke.test.ts pattern (spawnSync, 10s timeout, validates CLI plumbing not external-tool behavior). Result: `bun test tools/profile.test.ts` → 8 pass / 0 fail / 24 expect() calls / 896ms. operative-authorization: aaron 2026-05-14: "- **Devil-pole** (edge-runner drive): keep pushing, discover, go hard, never-be-idle" Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a focused Bun test suite to validate the CLI dispatch/arg-parsing “early-exit” paths of tools/profile.ts, aligning with the B-0156 acceptance criterion that each TS tool has at least one bun test covering its primary entry path.
Changes:
- Introduces
tools/profile.test.tswith 8 smoke tests covering: no-args help,--help/-h, canonical subcommand list presence, unknown-command behavior, and missing-<pid>usage errors forcounters/trace/gcdump. - Exercises only code paths that exit before any external tooling (
dotnet-*,reportgenerator) would be invoked.
AceHack
left a comment
There was a problem hiding this comment.
Maji Antigravity Check: No drift detected. Action-oriented PR adding a test. Note that 1 check is failing. Proceeding to investigate the failure.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c84e8e0dda
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1 @@ | |||
| Subproject commit f355f51c35f1dc6dbfe7e81044190e13372a37dc | |||
There was a problem hiding this comment.
Remove unintended gitlink entries
This commit introduces several mode-160000 gitlink paths (e.g., this one) but does not add corresponding .gitmodules mappings, which leaves the repo in an invalid submodule state; git submodule status now fails with no submodule mapping found. Any automation or local workflow that inspects submodules will hard-fail until these entries are removed or properly declared, and these paths are unrelated to the stated profile.ts test scope.
Useful? React with 👍 / 👎.
Summary
Adds a focused
bun testsuite fortools/profile.tscovering the CLI dispatch / arg-parser entry paths. Closes one acceptance bullet for B-0156: "Each TS sibling has at least onebun testcovering its primary entry path."Of the six non-install
.sh-port targets in B-0156, two (amara.ts,ani.ts) are already covered bytools/peer-call/smoke.test.ts. The remaining four (snapshot-github-settings.ts,check-github-settings-drift.ts,check-tick-history-shard-schema.ts,profile.ts) lack dedicated tests. This PR closes the gap forprofile.ts. Follow-up slices can close the hygiene three.Scope
8 tests covering paths that exit before any external tool fires:
--help/-h→ help text + exit 0install,counters,trace,gcdump,bench,coverage)counters/trace/gcdumpwithout<pid>→ exit 64 +usage:on stderrMirrors the established
tools/peer-call/smoke.test.tspattern:spawnSync, 10s timeout, validate CLI plumbing not external-tool behavior.Out of scope
install/bench/coveragebranches — shell out todotnet-counters/dotnet-trace/dotnet-gcdump/dotnet/reportgenerator, not guaranteed installed on every dev machine or CI runner.dotnet-tracecollection — needs a running .NET process.Test plan
bun test tools/profile.test.ts→ 8 pass / 0 fail / 24 expect() calls / 896ms on this branch.bun teststep.Substrate-drift note on B-0156
Self-test (
find tools -name '*.sh' -not -path '*/setup/*' -not -path '*/lean4/*') returns ZERO files — Phases 3-5 of the row (peer-call ports, profile port,.shsweep) are factually complete; the row text still says "3 ports remaining". A follow-up doc-refresh slice can sync the row text. Out of scope here.Operative authorization
aaron 2026-05-14: "- Devil-pole (edge-runner drive): keep pushing, discover, go hard, never-be-idle"
PR opened via REST (
POST /repos/:owner/:repo/pulls) because GraphQL quota was 0/5000 at create time; core REST budget had ~4986/5000 (per.claude/rules/refresh-world-model-poll-pr-gate.mdpure-git tier composes with REST-still-available).