test(#6169): suite uses unified Driver for repo allocate/deallocate/finalize - #6260
Conversation
…inalize Refactor the behaviour test suite to speak only to a unified install.Driver surface (AllocateRepo/DeallocateRepo/Finalize/ Capacity) instead of manually composing RepoEnsurer + RepoPool + MintDriver. Key changes: - Rename install.Driver → install.MintDriver to free the name for the unified interface. - Add install.Factory type and install.Driver interface per #6135. - Add composedDriver (internal) that wraps MintDriver + RepoEnsurer + channel-based pool into a unified Driver. - Add cfmint.NewFactory that closes over PEM/pool config, deploys the mint, creates the ensurer, and returns the composed Driver. - Update suite_test.go to use the factory — no ad-hoc composition of RepoEnsurer, RepoPool, or mint URL threading. - Update suite.InitScenario signature from (sc, template, pool) to (sc, template) — pool is internal to the driver. - Replace world.Ensurer with world.Driver (unified driver). - Update givenEnrolledTestRepository to call Driver.AllocateRepo with double-allocation guard. - After hook calls Driver.DeallocateRepo instead of pool.Release. - Concurrency > Capacity is an advisory t.Logf, not a fatal. - Finalize uses errors.Join for leak + mint teardown errors. - Update behaviour-drivers.md and behaviour-testing.md docs. Closes #6169
|
🤖 Review · Commit: |
Site previewPreview: https://ba3016eb-site.fullsend-ai.workers.dev Commit: |
|
/fs-fix CI Stale fragment
The behaviour-testing heading was renamed away from Update both links (and any nearby prose) to the current heading slug for the AllocateRepo / unified-driver lazy create+install section in |
|
🤖 Finished Fix · ✅ Success · Started 1:57 PM UTC · Completed 2:04 PM UTC Commit: |
Update two markdown links from #lazy-createinstall-repoensurer (removed heading) to #repo-allocation-via-unified-driver (current heading) and align nearby prose with the unified install.Driver terminology introduced in this PR. Addresses review feedback on #6260
🔧 Fix agent — iteration 1 (human-triggered)Fixed 2 stale markdown fragment links in e2e-testing.md and mint-administration.md that pointed to the removed #lazy-createinstall-repoensurer heading. Updated both to #repo-allocation-via-unified-driver and aligned nearby prose with the unified Driver terminology. lint-md-links now passes cleanly. Fixed (2):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 2:05 PM UTC · Completed 2:23 PM UTC Commit: |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ReviewFindingsMedium
Low
Previous runReviewFindingsMedium
Low
Labels: PR modifies e2e behaviour test infrastructure (pkg/behaviourtest/, e2e/behaviour/) and introduces new install.Driver unified interface |
|
/fs-fix get code coverage to 80% or above |
|
🤖 Finished Fix · ✅ Success · Started 2:41 PM UTC · Completed 2:54 PM UTC Commit: |
Extract the deploy-and-compose path from NewFactory into a package- internal buildFromMint helper so it can be tested with a fake MintDriver (NewFactory hard-codes NewDriver, which needs real PEM files and an external binary). New tests cover: - NewFactory returns a non-nil factory - NewFactory error path (invalid config → NewDriver fails) - buildFromMint happy path with MintURLProvider state - buildFromMint install failure - buildFromMint with state that lacks MintURLProvider - buildFromMint with invalid pool size Coverage for cfmint/driver.go NewFactory: 0% → 80%. Package cfmint overall: 76.3% → 93.5%. Addresses review feedback on #6260
🔧 Fix agent — iteration 2 (human-triggered)Addressed coverage gap in cfmint/driver.go by extracting buildFromMint helper and adding 7 tests. NewFactory coverage 0% → 80%, package cfmint 76.3% → 93.5%. All changed files are well above the 80% patch coverage threshold. Fixed (1):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 2:55 PM UTC · Completed 3:12 PM UTC Commit: |
|
🤖 Finished Retro · ✅ Success · Started 3:41 PM UTC · Completed 3:53 PM UTC Commit: |
Retro: PR #6260 — unified Driver for behaviour test suiteOutcome: Merged after 2 fix iterations (6 agent runs on this PR). However, this was the second attempt — the predecessor PR #6172 was abandoned after 15 agent runs over 3 days due to a gitleaks scan-range bug after rebase. Total cost across both PRs: 21 agent runs for an issue that should have required ~6. What went well
What could go betterReview quality — 3/3 medium findings were false positives. The review agent flagged Evidence for existing open issues
Proposals filed |
Summary
Refactors the behaviour test suite to use a unified
install.Driver(AllocateRepo/DeallocateRepo/Finalize/Capacity) instead of manually composingRepoEnsurer+RepoPool+MintDriver. The suite now takes a singleFactory/Driverand does not construct or thread those components itself.Related Issue
Implements #6169 (child of #6135).
Changes
install.Driverrenamed toinstall.MintDriverto free theDrivername for the unified interface (transitional until test(behaviour): fold RepoPool and RepoEnsurer into environment install drivers #6170)install.Factorytype and unifiedinstall.Driverinterface withAllocateRepo/DeallocateRepo/Finalize/Capacityper the contract defined in test(behaviour): consolidate install driver, RepoEnsurer, and RepoPool behind one driver interface #6135composedDriver(internal helper) that wrapsMintDriver+RepoEnsurer+ channel-based pool into a unifiedDrivercfmint.NewFactorythat closes over PEM/pool config, deploys the preview mint, creates the ensurer, and returns the composedDriversuite_test.go— uses factory instead of ad-hoc composition; no directRepoPool,RepoEnsurer, or mint URL threadingsuite.InitScenariosignature from(sc, template, pool)to(sc, template)— pool is internal to the driverworld.Ensurerwithworld.Driver(unified driver field)givenEnrolledTestRepositoryto callDriver.AllocateRepowith double-allocation guardDriver.DeallocateRepoinstead ofpool.Releaset.Logfwarning, not a fatal (per test(behaviour): consolidate install driver, RepoEnsurer, and RepoPool behind one driver interface #6135)Finalizeuseserrors.Joinfor leak + mint teardown errorsbehaviour-drivers.mdandbehaviour-testing.mdfor Factory/Driver, API changesTesting
pkg/behaviourtest/...unit tests pass with-racecomposed_test.gocovers: allocate/deallocate, double-dealloc guard, unknown name guard, blocking when at capacity, ensure error returns slot to pool, finalize with/without outstanding leases, errors.Join behavior, concurrent allocate/deallocate under -racesuite/init_test.gotests for new Before/After hooks with unified drivergo vetpasses for all changed packages (including-tags behaviour)Checklist
!for breaking changes)Closes #6169
Post-script verification
agent/6169-unified-driver-suite)53456d472dcba81bcea79f8d715e9d6159cefa5c..HEAD)