refactor(spec-0031): align BoxProvisioning test naming to convention#4172
Conversation
…convention (T2)
- Class When_... -> [Behavior]Tests:
When_hosted_service_is_started_with_a_provisioner_for_an_unrecognised_box_type_it_should_throw_argument_out_of_range
-> BoxProvisioningHostedServiceUnknownBoxTypeTests
When_hosted_service_outbox_provisioner_throws_then_inbox_provisioner_should_not_run
-> BoxProvisioningHostedServiceFailureShortCircuitTests
- Method Should_... -> When_..._should_... (matching the already-conforming file names)
- File names already conform -> unchanged. No behaviour/assertion/count change.
- Verify: build clean; suite 111/111 (parity vs T1 baseline).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n (T3) - 18 WRONG files: class When_... -> [Behavior]Tests (+ constructors), methods Should_... -> When_..._should_... - 4 MIXED files: methods Should_... -> When_..._should_... only (classes already conformed) - File names already conformed -> unchanged (no git mv needed). - Updated 1 doc-comment cross-ref (<c>...rollback_async...</c> -> ProvisioningUnitOfWorkRollbackTests); left a file-name comment (...writer_slot_lock.cs) intact since the file is not renamed. - No behaviour/assertion/count change. Verify: build clean; suite 127/127 (parity vs T1). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… (T4) - 33 WRONG files: class When_... -> MsSql[Behavior]Tests (folder-consistent prefix; + constructors), methods Should_... -> When_..._should_... - File names already conformed -> unchanged (no git mv). - Updated 1 doc-comment cross-ref (<c>...rollback_async...</c> -> MsSqlProvisioningUnitOfWorkRollbackAfterCommitThrewTests). - No behaviour/assertion/count change. Verify: build clean; suite 185 passed / 13 failed / 198 total = exact parity vs T1 baseline (13 pre-existing failures preserved: 12 DateTimeOffset/BST #4161 + 1 in-scope lock-resource-schema test now under renamed FQN, same assertion). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… (T5) - 24 WRONG files: class When_... -> MySql[Behavior]Tests (+ ctors), methods Should_... -> When_..._should_... - 3 MIXED files: methods Should_... -> When_..._should_... only (classes already conformed). - File names already conformed -> unchanged (no git mv). - Updated 1 comment cross-ref (...begin_throws... -> MySqlProvisioningUnitOfWorkBeginThrowsTests). - No behaviour/assertion/count change. Verify: Docker available; build clean; suite 160/160 (parity vs T1). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ntion (T6) - 34 WRONG files: class When_... -> PostgreSql[Behavior]Tests (+ ctors), methods Should_... -> When_..._should_... - File names already conformed -> unchanged (no git mv). - Updated 2 comment cross-refs (advisory_unlock + begin_transaction_throws) to the new class names. - No behaviour/assertion/count change. Verify: Docker available; build clean; suite 191/191 (parity vs T1). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ement complete - Spec 0031 (test naming conventions for BoxProvisioning): requirements, tasks (all 7 ticked), approval markers, and verification evidence (.scratch baseline + T7 sign-off). - PROMPT.md resume-state updated to IMPLEMENTATION COMPLETE. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Records implementation+verification complete; leads next session with the question of whether a code review is warranted for a style-only rename diff. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Review — refactor(spec-0031): align BoxProvisioning test naming Reviewed as a pure rename refactor (118 test files; class to ✅ What checks out
🟡 Minor: SQLite project is inconsistently prefixed 🟡 Minor: file name no longer matches class name 🧹 Cleanup: scratch evidence + PROMPT.md churn in the diff
Nice, disciplined refactor. The substantive ask is just the SQLite prefix consistency; the rest is cleanup/process. — Automated review (Claude) |
Review —
|
…in MigrateAsync The spec-0030 retype of MigrateAsync's schemaName parameter from `string?` to the SchemaName value type silently changed its null semantics. With `string?`, `if (schemaName is not null)` skipped the AssertSafe gate for an unconfigured schema, so it defaulted (e.g. to dbo). With SchemaName, a null string reaches the method via the implicit string->SchemaName conversion as a *non-null* wrapper whose Value is null, so the bare reference check is true and AssertSafe(null) throws ConfigurationException — a path no caller intends. Adopt SchemaName.IsNullOrEmpty (the canonical "absent" check, mirroring Id.IsNullOrEmpty) and collapse every absent form (null reference, wrapped-null, wrapped-empty) to a single null. The AssertSafe gate and every downstream `schemaName?.Value ?? <backend default>` then treat them identically, restoring the original `string?` semantics. Fix is in the shared base runner, so it covers MSSQL/PostgreSQL/MySQL/SQLite. Regression guard: MsSqlRunnerLockResourceSchemaQualificationTests' (null -> "dbo") Theory case exercises the implicit-conversion path; it failed before this fix and passes after. Verified green: BoxProvisioning base 111/111; Sqlite 127/127; MSSQL box-prov 85/85; MySQL box-prov 78/78; PostgresSQL box-prov 76/76 (net9.0). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
*.db is already ignored, but the SQLite WAL-mode sidecars (*.db-shm, *.db-wal) and rollback journal (*.db-journal) are not — they appear as untracked noise when running the WebAPI Dapper/SQLite samples (e.g. GreetingsWeb/Greetings.db). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Gates Failed
Prevent hotspot decline
(1 hotspot with Complex Method)
Enforce advisory code health rules
(1 file with Complex Method)
Our agent can fix these. Install it.
Gates Passed
2 Quality Gates Passed
Reason for failure
| Prevent hotspot decline | Violations | Code Health Impact | |
|---|---|---|---|
| SqlBoxMigrationRunner.cs | 1 rule in this hotspot | 8.58 → 8.56 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| SqlBoxMigrationRunner.cs | 1 advisory rule | 8.58 → 8.56 | Suppress |
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
|
Code Review — PR 4172 (spec-0031 test naming) Reviewed the diff against 1. Scope / description mismatch (please address) The PR is titled and described as a pure rename refactor and the What did NOT change section states 0 changes to 2. The SchemaName fix is correct and well-reasoned Subtle root cause: 3. Test coverage for the fix is thin relative to its blast radius The fix lives in the shared base 4. Minor: sibling checks don't share the new absent=null-or-empty semantics The fix makes empty-wrapped schema mean absent for the 5. Renames — looks good Spot-checked the mechanics: class + constructor + method + doc-comment cross-refs updated together (e.g. Summary: No blockers in the code itself — the rename is clean and the SchemaName fix is correct. The one thing to resolve before merge is the scope/description mismatch (item 1): split the behavioural fix out or correct the 0 changes to src/ claim, and ideally add the cheaper regression guard from item 3. Reviewed by Claude (Opus 4.8). |
Code Review — PR #4172 (spec-0031 test naming)Thanks for the careful, well-documented work. The 118 renames are clean: license headers, I do have one substantive concern about scope/accuracy that I'd ask you to address before merge. 🔴 The PR is not actually rename-only — it contains a behavioural
|
This was a bug caused by an earlier merge to remove primitive obsession. As it prevented a green build, we needed to fix it to merge. We prioritize a clean build over the fix mixing with this PR. |
Summary
Spec 0031 — a pure rename refactor that brings 5 BoxProvisioning test projects into line with the test naming convention in
.agent_instructions/testing.md:[Subject]TestsWhen_..._should_...When_....cs)118 non-conforming test files renamed across MSSQL, MySQL, PostgreSQL, SQLite and the shared
BoxProvisioning.Tests. 0WRONG+ 0MIXEDclassifications remain. Closes #4157.What did NOT change
This is style-only — identifier and comment renames. No behaviour, no assertions, no logic, no test counts:
Assert.lines touchedsrc/, analyzers, CI, or agent-instruction filesVerification
All 5 projects build clean and the suites match baseline. MSSQL retains its 13 pre-existing failures (12 = DateTimeOffset/BST #4161, 1 now under a renamed FQN) — unchanged by this PR.
Full sign-off evidence:
specs/0031-test_naming_conventions/.scratch/T7-signoff.md.Commits
🤖 Generated with Claude Code