Repository navigation
chore(openspec): archive less-tests change - #1245
Conversation
|
This change is part of the following stack:
Change managed by git-spice. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis pull request introduces a comprehensive initiative to reduce Go test suite execution time under ChangesTest Suite Efficiency Initiative
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Code Review
This pull request archives the 'less-tests' initiative, which aimed to optimize the Go test suite by reducing redundancy and sharing expensive fixtures. It introduces a new 'test-suite-efficiency' specification and updates the 'short-test-mode' requirements to mandate profiling before gating slow tests. Feedback identifies an inconsistency between the design document and the implementation of the profiling tool, a conflict between Nix sandboxing and the requirement to write timing reports to the source tree, and missing justifications for removed tests in the archived task list.
dba7e1e to
2e2fcbe
Compare
fd13864 to
3280a3d
Compare
2e2fcbe to
2530d08
Compare
3280a3d to
b021b1c
Compare
Address two review comments from PR #1245: - design.md: The profiling tool was implemented as Python (dev-scripts/profile-tests.py), not an awk/jq pipeline. Update the D1 rationale to reflect the actual implementation. - spec.md: The "writes the ranking to a file" step contradicts running inside nix flake check, where the source tree is read-only (Nix sandbox). Qualify the requirement as local execution only so the spec no longer contradicts itself.
2530d08 to
babdf33
Compare
b021b1c to
865bd36
Compare
Address two review comments from PR #1245: - design.md: The profiling tool was implemented as Python (dev-scripts/profile-tests.py), not an awk/jq pipeline. Update the D1 rationale to reflect the actual implementation. - spec.md: The "writes the ranking to a file" step contradicts running inside nix flake check, where the source tree is read-only (Nix sandbox). Qualify the requirement as local execution only so the spec no longer contradicts itself.
babdf33 to
f3d9b91
Compare
865bd36 to
aafc660
Compare
Address two review comments from PR #1245: - design.md: The profiling tool was implemented as Python (dev-scripts/profile-tests.py), not an awk/jq pipeline. Update the D1 rationale to reflect the actual implementation. - spec.md: The "writes the ranking to a file" step contradicts running inside nix flake check, where the source tree is read-only (Nix sandbox). Qualify the requirement as local execution only so the spec no longer contradicts itself.
f3d9b91 to
f54c8bb
Compare
aafc660 to
001e3bc
Compare
Address two review comments from PR #1245: - design.md: The profiling tool was implemented as Python (dev-scripts/profile-tests.py), not an awk/jq pipeline. Update the D1 rationale to reflect the actual implementation. - spec.md: The "writes the ranking to a file" step contradicts running inside nix flake check, where the source tree is read-only (Nix sandbox). Qualify the requirement as local execution only so the spec no longer contradicts itself.
f54c8bb to
5f830c5
Compare
001e3bc to
57df5d2
Compare
Address two review comments from PR #1245: - design.md: The profiling tool was implemented as Python (dev-scripts/profile-tests.py), not an awk/jq pipeline. Update the D1 rationale to reflect the actual implementation. - spec.md: The "writes the ranking to a file" step contradicts running inside nix flake check, where the source tree is read-only (Nix sandbox). Qualify the requirement as local execution only so the spec no longer contradicts itself.
5f830c5 to
684c5a5
Compare
57df5d2 to
c10ebf4
Compare
Address two review comments from PR #1245: - design.md: The profiling tool was implemented as Python (dev-scripts/profile-tests.py), not an awk/jq pipeline. Update the D1 rationale to reflect the actual implementation. - spec.md: The "writes the ranking to a file" step contradicts running inside nix flake check, where the source tree is read-only (Nix sandbox). Qualify the requirement as local execution only so the spec no longer contradicts itself.
684c5a5 to
27b0281
Compare
c10ebf4 to
51b21ab
Compare
Address two review comments from PR #1245: - design.md: The profiling tool was implemented as Python (dev-scripts/profile-tests.py), not an awk/jq pipeline. Update the D1 rationale to reflect the actual implementation. - spec.md: The "writes the ranking to a file" step contradicts running inside nix flake check, where the source tree is read-only (Nix sandbox). Qualify the requirement as local execution only so the spec no longer contradicts itself.
Adds the archived openspec change directory and updates the short-test-mode and test-suite-efficiency specs to reflect the shipped state of the stack.
51b21ab to
3479580
Compare
Address two review comments from PR #1245: - design.md: The profiling tool was implemented as Python (dev-scripts/profile-tests.py), not an awk/jq pipeline. Update the D1 rationale to reflect the actual implementation. - spec.md: The "writes the ranking to a file" step contradicts running inside nix flake check, where the source tree is read-only (Nix sandbox). Qualify the requirement as local execution only so the spec no longer contradicts itself.
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 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 `@openspec/changes/archive/2026-05-23-less-tests/design.md`:
- Around line 83-85: The fenced code block containing the test command lacks a
language identifier; update the snippet that currently shows `go test
-coverpkg=./... -coverprofile=cover-after.out -race ./<changed-pkg>/...` to
include a language tag (e.g., bash) after the opening backticks so the block
becomes a bash code block and markdown linting passes.
- Line 39: The documented baseline output path currently references
"openspec/changes/less-tests/baseline-timings.txt" which conflicts with the
archived change location; update the path in the sentence to point to the
archived location (e.g., replace "openspec/changes/less-tests/..." with the
archived path used in this change note) so readers are directed to the correct
archived baseline file mentioned in this document.
In `@openspec/changes/archive/2026-05-23-less-tests/tasks.md`:
- Line 63: Replace the incorrect script name "profile-tests.sh" with the actual
profiler script "dev-scripts/profile-tests.py" in the task description (the line
that currently reads `7.1 Re-run profile-tests.sh ...`), ensuring the
instruction references the Python script path exactly and leaves the output
filename `openspec/changes/less-tests/post-change-timings.txt` unchanged; update
any adjacent text that repeats the `.sh` name to the `.py` path as well.
- Line 5: Update the task description that references the archived baseline path
so it points to the archived change directory: change the target path that
mentions "openspec/changes/less-tests/baseline-timings.txt" to the archived
location including "2026-05-23-less-tests/baseline-timings.txt" so the
instruction for running "profile-tests.py" and saving to "baseline-timings.txt"
correctly stores the file under the archive folder.
- Around line 7-10: The markdown table under the "Top-5 packages by wall time:"
heading is missing blank lines before and after it which triggers markdownlint
MD058; insert a single blank line between the heading text ("Top-5 packages by
wall time:") and the table start, and another blank line after the table end so
the table is separated from surrounding text, ensuring MD058 is satisfied.
In `@openspec/specs/test-suite-efficiency/spec.md`:
- Around line 48-49: Replace the unsupported "Branch coverage per affected
package MUST NOT decrease by more than 1 percentage point." requirement with a
requirement that matches the metric produced by the documented workflow: e.g.,
change it to "Statement (instrumented-block) coverage per affected package MUST
NOT decrease by more than 1 percentage point" and add a clarifying sentence that
this is measured using the existing go test -coverprofile / go tool cover flow;
alternatively, if true branch-level enforcement is required, replace that
sentence by a concrete measurement approach (name a branch-coverage
tool/workflow and the exact commands to produce branch coverage) so the spec and
the described Go workflow are consistent.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ea1a8a3a-327e-43cb-8d38-970bb40935a4
📒 Files selected for processing (15)
openspec/changes/archive/2026-05-23-less-tests/.openspec.yamlopenspec/changes/archive/2026-05-23-less-tests/after-batch1-timings.txtopenspec/changes/archive/2026-05-23-less-tests/after-batch2-timings.txtopenspec/changes/archive/2026-05-23-less-tests/after-batch3-timings.txtopenspec/changes/archive/2026-05-23-less-tests/baseline-timings.txtopenspec/changes/archive/2026-05-23-less-tests/design.mdopenspec/changes/archive/2026-05-23-less-tests/integration-after-batch5-timings.txtopenspec/changes/archive/2026-05-23-less-tests/integration-after-dbclose-timings.txtopenspec/changes/archive/2026-05-23-less-tests/integration-baseline-timings.txtopenspec/changes/archive/2026-05-23-less-tests/proposal.mdopenspec/changes/archive/2026-05-23-less-tests/specs/short-test-mode/spec.mdopenspec/changes/archive/2026-05-23-less-tests/specs/test-suite-efficiency/spec.mdopenspec/changes/archive/2026-05-23-less-tests/tasks.mdopenspec/specs/short-test-mode/spec.mdopenspec/specs/test-suite-efficiency/spec.md
Address two review comments from PR #1245: - design.md: The profiling tool was implemented as Python (dev-scripts/profile-tests.py), not an awk/jq pipeline. Update the D1 rationale to reflect the actual implementation. - spec.md: The "writes the ranking to a file" step contradicts running inside nix flake check, where the source tree is read-only (Nix sandbox). Qualify the requirement as local execution only so the spec no longer contradicts itself.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1245 +/- ##
=====================================
Coverage 5.50% 5.50%
=====================================
Files 6 6
Lines 400 400
=====================================
Hits 22 22
Misses 374 374
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Address two review comments from PR #1245: - design.md: The profiling tool was implemented as Python (dev-scripts/profile-tests.py), not an awk/jq pipeline. Update the D1 rationale to reflect the actual implementation. - spec.md: The "writes the ranking to a file" step contradicts running inside nix flake check, where the source tree is read-only (Nix sandbox). Qualify the requirement as local execution only so the spec no longer contradicts itself.
Addresses PR #1245 threads PRRT_kwDONV6tZs6EV3Z6, PRRT_kwDONV6tZs6EV3Z7, PRRT_kwDONV6tZs6EV3Z8, PRRT_kwDONV6tZs6EV3Z_, PRRT_kwDONV6tZs6EV3aA, PRRT_kwDONV6tZs6EV3aB. archive/2026-05-23-less-tests/design.md: - Fix baseline output path: openspec/changes/less-tests/ → openspec/changes/archive/2026-05-23-less-tests/ (matches the archived change directory). - Add `bash` language tag to the fenced code block (MD040). - Replace "branch coverage" with "statement/block coverage" — Go's go test -coverprofile reports instrumented-block coverage, not source-level branch coverage per the official cover docs. archive/2026-05-23-less-tests/tasks.md: - Fix baseline path to match archived directory (line 5). - Add blank line before table to satisfy MD058. - Fix task 7.1: profile-tests.sh → profile-tests.py; fix output path to point to the archived directory. openspec/specs/test-suite-efficiency/spec.md: - Replace "Branch coverage" with "Statement/instrumented-block coverage" throughout to match what go test -coverprofile actually measures. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…1251) ## Summary Consolidation branch addressing unresolved reviewer threads left open across merged PRs #1179–#1246. Each fix has its own atomic commit referencing the source PR and thread ID; all threads are resolved on GitHub after each change. ### Bug fixes - **cache:** touch `nar_file` by fetched row ID, not by narURL fields — `getNarFileFromDB` can return a `compression=none` fallback whose key differs from `narURL`, causing stale `last_accessed_at` and LRU regressions (#1206) - **cache:** fail fast on `nil` eager-loaded chunk edges in `streamCompleteChunks` and `streamProgressiveChunks` instead of silently `continue`-ing, which caused count mismatches or infinite re-streaming (#1207) - **cache:** include `narURLsToRemove` in the LRU early-return guard so orphaned `NarFile` blobs are passed to `parallelDeleteFromStores` instead of being silently leaked in storage (#1215) - **cache:** log a warning when LRU candidate fetch hits the `maxFetchRows` cap so operators know eviction scanned only a partial window (#1206) - **cache/relink:** lower `relinkBatchSize` from 500 → 499 to stay under SQLite's 999-placeholder limit (500 rows × 2 binds = 1000 > 999) (#1208) - **database:** close `*sql.DB` in `Open()` when `NewClient` fails (#1208) - **migrate/adopt:** use `ErrUnknownState` (not `ErrUnknownDialect`) for unrecognised `State` values — fixes false-positive `errors.Is` checks (#1188) - **generate-migrations:** `parseSkip` validates dialect names, returning an error on unknown values like `"myslq"` instead of silently skipping them (#1187) - **generate-migrations:** `--sql-only` path now calls `ensureAtlasSum` after writing the stub so `atlas.sum` stays in sync (#1187) - **generate-migrations:** `runDialect` now returns the generated file path and prints it to stdout; `main()` warns when a second boundary falls between dialect runs so callers know to re-run for a consistent timestamp set (#1215) - **generate-migrations:** add `"empty"` to `validateName` reject list (#1185) - **nix/ent-lint-check:** add `set -o pipefail` so `ent-lint | tee` propagates a non-zero exit through the pipeline (#1221) - **e2e:** fix docstring path (`var/ncps/e2e-results/` → `.e2e-results/`); `mc mb` and `redis-cli flushall` now use `check=True` so reset failures abort the test immediately (#1233) - **e2e:** `stop_ncps` now verifies the port closes within timeout; `wait_ready` exits early if the child process dies before becoming ready (#1233) - **run.py:** guard `dbmate` usage with a `shutil.which` check so a missing binary fails fast with a clear message instead of an obscure error (#1234) - **CI:** pin all external GitHub Action refs to immutable commit SHAs to prevent supply-chain mutation (#1223) - **CI:** remove `release-*` from pull_request/push triggers; add `go.mod` and `go.sum` to the ent paths-filter (#1235) - **docs:** replace distroless-incompatible `wget` healthcheck in Docker Compose example with `garage status` (#1223) ### Test fixes - Replace non-fatal `assert.Len` → `require.Len` before indexing `stamps[0..2]` in `generate-migrations` tests (#1185) - Add 60 s timeout to the one-time `go build` in the test setup (#1241) - Fix `cache_prefetch_test.go` to look up `nar_file` by `(hash, compression, query)` instead of hard-coded `id=1` (#1218) - Apply `NarSize` fallback when `FileSize == 0` in `testhelper/sqlite.go` to avoid impossible `file_size=0` fixture rows for `compression=none` narinfos (#1218) - Increase `chunkingDelay` from 500 ms → 1 s in `cdc_test.go` to reduce flakiness on slow CI machines (#1217) - Replace `Lock`-with-timeout with `TryLock` in `cache_distributed_test.go` to avoid spurious failures when the lock-hold window is tight (#1217) ### Docs / skills - Quote PostgreSQL DSNs in shell-command examples to prevent `?`-glob expansion by shells (#1234) - `migrate-new/SKILL.md`: ent-lint checks A1, A2, A4 — not all five invariants as previously stated (#1225) - `migrate-down/SKILL.md`: clarify that `DROP COLUMN` is sensitive/forbidden DDL per the migration spec and is only permissible as the terminal expand-contract step; add the missing "deploy code that always writes non-null" step to the NOT NULL recipe (#1225) - `openspec/changes/archive/2026-05-23-less-tests/`: fix stale paths, add `bash` fence tag, replace "branch coverage" with "statement/block coverage" (#1245) - `openspec/specs/test-suite-efficiency/spec.md`: same coverage terminology fix (#1245) - `openspec/changes/archive/2026-05-21-migrate-to-ent-and-atlas/design.md`: add language tag to decision-tree fence block; fix grammar (#1186) - `openspec/changes/archive/2026-05-21-migrate-to-ent-and-atlas/tasks.md`: update §10.1/§11.1 notes to reflect that `*database.Client` threading was completed in §11, not deferred (#1191, #1192) ## Test plan - [x] `nix flake check` (includes all unit + integration tests, lint, ent-lint, atlas-sum, helm-unittest, schema-equivalence) - [x] `go test -race ./...` locally with `eval "$(enable-integration-tests)"` - [x] Verify all referenced GitHub threads are marked resolved 🤖 Generated with [Claude Code](https://claude.ai/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Adds the archived openspec change directory and updates the
short-test-mode and test-suite-efficiency specs to reflect the
shipped state of the stack.