Repository navigation
test: CI drift guards clean; refuse registrations after the conclave seals - #26
Merged
Merged
Conversation
c.Command, Data.New, Data.MountDir and Drive.New discarded the Registry.Set result, so once WithServiceLock sealed the conclave at startup they returned OK while registering nothing. They now return the refusal. Found writing the sealConclave triplet: a command registered after the seal reported success. Action, Task and API.RegisterProtocol drop the same result but return no Result to carry it; fixing those changes their signatures, so it's separate. Co-Authored-By: Virgil <virgil@lethean.io>
The naming guard listed 29 symbols without Test*_{Good,Bad,Ugly} and the
test-imports guard 19 files importing stdlib; both now pass (833 symbols,
211 files), so CI's red means something again.
- 13 symbols were tested under short names (TestConfig_FromEnv_Good):
renamed to the house Test<File>_<Type>_<Method>_<Variant> form, 39 tests.
- 16 had no tests: Config featureFlags/key/lock/mergeMap, sealConclave,
Policy.match, Pool Get/Put/Len, evalDeepestSymlinks, executableCandidates,
hasListedExt, splitPathExt, newCore, readAllSized, registerBuiltins.
pool_test.go is rewritten in house style; its "drops reference" test now
checks the backing slot (before, it passed whether or not Get leaked).
- Test files use core helpers instead of stdlib. New aliases for what core
lacked: PB, MapFS, MapFile (test.go, the testing SPOR owner) and
LineScanner (what NewLineScanner returns).
- Three things only internal code can do stay in *_internal_test.go:
BenchmarkPrintln swaps os.Stdout; BenchEmbedFS needs go:embed;
SliceDataPtr/PinSinkPtr need unsafe. Exported test vars reach core_test.
go test -race, go vet, gofmt and one pass of every benchmark are clean.
Co-Authored-By: Virgil <virgil@lethean.io>
Contributor
|
Caution Review failedThe pull request is closed.
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI on main has been red on the drift guards. They run after the tests, so a red run hid whether the tests passed. This PR makes all three guards pass.
Bug found on the way (separate commit):
c.Command,Data.New,Data.MountDirandDrive.NewdiscardedRegistry.Set's result. OnceWithServiceLocksealed the conclave, they returnedOKwhile registering nothing. They now return the refusal.Action,TaskandAPI.RegisterProtocoldrop the same result, but they have noResultto carry it in, so fixing them changes their signatures. That's left for a follow-up.AX-7 naming (29 → 0 gaps, 833 symbols):
Test<File>_<Type>_<Method>_<Variant>.pool_test.gois rewritten. Its "drops reference" test now checks the backing slot; before, it passed whether or notGetleaked the value.Test imports (19 → 0 files):
PB,MapFS,MapFile(intest.go, the testing SPOR owner) andLineScanner.*_internal_test.goand are exported tocore_test:BenchmarkPrintlngo:embedfixtureunsafepointer helpersChecked:
go test -race,go vet,gofmtand one pass of every benchmark are clean.🤖 Generated with Claude Code
Co-Authored-By: Virgil virgil@lethean.io