Skip to content

test: shorten the default feedback loop - #146

Merged
AustinKelsay merged 9 commits into
stagingfrom
feature/fast-default-test-loop
Jul 19, 2026
Merged

test: shorten the default feedback loop#146
AustinKelsay merged 9 commits into
stagingfrom
feature/fast-default-test-loop

Conversation

@AustinKelsay

@AustinKelsay AustinKelsay commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Closes #137

Summary

  • split the default Jest and Bun commands into canonical routine and explicit slow security/performance lanes
  • preserve complete assurance in CI across Node 16/18/20 and Bun, with complete coverage on Node 20
  • remove avoidable NIP-46 parser-validation waits while retaining public integration coverage
  • preserve targeted Jest invocations and cover both .test and .spec discovery contracts

Evidence

  • baseline Jest: 85 suites / 1096 tests / 58.793s
  • routine Jest: 84 suites / 1062 tests / 32.391s (44.9% faster)
  • slow Jest: 2 suites / 40 tests / 43.640s
  • routine Bun: 84 files / 1062 tests / 190.51s
  • slow Bun: 2 files / 40 tests / 40.41s
  • complete coverage: 86 suites / 1102 tests / 53.732s
  • command and package policies, lint, strict types, builds, examples, pack, Grok review, and local CodeRabbit review all pass

Summary by CodeRabbit

  • New Features
    • Added separate routine, slow security/performance, and complete coverage test lanes.
    • Enabled lane-based test execution for both Node.js and Bun, including combined assurance runs.
  • Documentation
    • Updated README, tests docs, and agent guidance to reference the new test lanes and CI behavior.
    • Added detailed review/session materials covering the lane-based testing approach.
  • CI / Tests
    • Expanded CI test steps to include routine tests, slow security/performance coverage, and full coverage inventories.
  • Bug Fixes
    • Improved NIP-46 connection-string validation tests with more deterministic parsing and safer cleanup.

@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@AustinKelsay

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6db56329-6fe1-4084-ab8c-f13faa91608b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The test system now defines routine and slow lanes, routes Node and Bun commands through a shared runner, expands CI coverage, updates testing documentation, and validates lane partitioning. NIP-46 security tests also use deterministic parsing and guarded connection cleanup.

Changes

Test lane implementation

Layer / File(s) Summary
Lane discovery and selection
scripts/test-lanes.js, tests/nip44/*, tests/nip46/performance-security.test.ts
Discovers test files, marks slow suites, separates routine and slow lanes, and generates Jest lane arguments.
Runtime execution and package scripts
scripts/run-test-lane.js, package.json
Runs selected Jest or Bun lanes and wires routine, slow, all, watch, and coverage commands through the runner.
CI and command documentation
.github/workflows/build-test.yml, README.md, tests/README.md, AGENTS.md, CLAUDE.md
Splits Node and Bun CI tests into routine and slow steps, adds complete coverage execution, and documents the updated commands.
Validation and issue records
tests/scripts/test-lanes.test.ts, tests/nip46/input-validation.test.ts, docs/agents/runs/*
Validates lane discovery and wiring, uses direct connection-string parsing assertions and guarded cleanup in NIP-46 tests, and records issue implementation and integration status.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CI
  participant RunTestLane
  participant TestLaneModule
  participant JestOrBun
  CI->>RunTestLane: invoke routine or slow test command
  RunTestLane->>TestLaneModule: resolve lane files and arguments
  RunTestLane->>JestOrBun: execute selected suite
  JestOrBun-->>CI: return test status
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: shortening the default test feedback loop.
Linked Issues check ✅ Passed The changes add routine/slow lanes, deterministic test handling, timing evidence, and CI coverage across Node and Bun as requested by #137.
Out of Scope Changes check ✅ Passed The added scripts, tests, workflow updates, and supporting docs all align with the test-lane and feedback-loop goals.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fast-default-test-loop

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/agents/runs/cleanup-1-9-ledger.md`:
- Line 12: Update the top-level “Current status” entry in the ledger to mark
item 7 / issue `#137` as PR pending, matching the status recorded in the issue
`#137` entries at Lines 30 and 50; leave the statuses for items 1–6 unchanged.

In `@scripts/run-test-lane.js`:
- Around line 31-40: The Bun branch in scripts/run-test-lane.js must use dynamic
routine watch discovery instead of passing the fixed testFiles list, while
preserving the existing concurrency, timeout, and extra-argument handling. Add
coverage in tests/scripts/test-lanes.test.ts for the Bun runner arguments,
verifying routine watch mode uses dynamic discovery and newly added tests can be
detected.

In `@tests/README.md`:
- Around line 81-85: Update the test command documentation around the routine
and complete assurance commands to include the standalone slow-lane commands:
add npm run test:slow to the npm command block and bun run test:bun:slow to the
Bun block, while preserving the existing commands.

In `@tests/scripts/test-lanes.test.ts`:
- Around line 69-110: Extend the tests around the runtime-dispatch logic to
verify the arguments passed to spawned Bun processes for routine watch mode,
including the expected static test-file filters. Prefer exposing a pure
argument-builder function from the runtime-dispatch implementation, then assert
its routine watch output directly in tests while preserving existing script and
Jest argument coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4d73024b-6477-4616-83e7-be6d4f5fea9a

📥 Commits

Reviewing files that changed from the base of the PR and between 8b970e4 and 45a1a4f.

📒 Files selected for processing (13)
  • .github/workflows/build-test.yml
  • AGENTS.md
  • CLAUDE.md
  • README.md
  • docs/agents/runs/cleanup-1-9-ledger.md
  • docs/agents/runs/issue-137-review-packet.md
  • docs/agents/runs/issue-137-session.md
  • package.json
  • scripts/run-test-lane.js
  • scripts/test-lanes.js
  • tests/README.md
  • tests/nip46/input-validation.test.ts
  • tests/scripts/test-lanes.test.ts

Comment thread docs/agents/runs/cleanup-1-9-ledger.md Outdated
Comment thread scripts/run-test-lane.js Outdated
Comment thread tests/README.md Outdated
Comment thread tests/scripts/test-lanes.test.ts
@AustinKelsay

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.


You're currently rate limited under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. Your next review will be available in 22 minutes.

@AustinKelsay

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/README.md`:
- Around line 75-80: Update the test command documentation so the standalone npm
run test:slow command and the complete npm run test:all command appear in
separate sections, making clear that test:all already includes the slow suite
and must not be run after it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e698722a-012e-442d-bd96-fa8dc797b109

📥 Commits

Reviewing files that changed from the base of the PR and between 8b970e4 and 2c278e7.

📒 Files selected for processing (15)
  • .github/workflows/build-test.yml
  • AGENTS.md
  • CLAUDE.md
  • README.md
  • docs/agents/runs/cleanup-1-9-ledger.md
  • docs/agents/runs/issue-137-review-packet.md
  • docs/agents/runs/issue-137-session.md
  • package.json
  • scripts/run-test-lane.js
  • scripts/test-lanes.js
  • tests/README.md
  • tests/nip44/nip44-performance-security.test.ts
  • tests/nip46/input-validation.test.ts
  • tests/nip46/performance-security.test.ts
  • tests/scripts/test-lanes.test.ts

Comment thread tests/README.md Outdated
@AustinKelsay
AustinKelsay merged commit b33f31f into staging Jul 19, 2026
5 checks passed
@AustinKelsay
AustinKelsay deleted the feature/fast-default-test-loop branch July 19, 2026 11:54
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.

1 participant