Give each source file exactly one test file - #76
Merged
Merged
Conversation
Five sources had their tests split across two files. The second file becomes a nested group in the first, which keeps one test file per source without reconciling two sets of fixtures that name the same helpers differently. The accessor tests of MetaFilter and NamespaceConfig merge outright, since neither carried fixtures. One MetaFilter test asserted what another already asserted and is dropped, which is the one test the count falls by.
drametwally
force-pushed
the
one-test-file-per-source
branch
from
September 20, 2026 23:28
8af2dd4 to
251e23f
Compare
The header justified the run on main by a branch merging on a pass from before it was rebased, which protection no longer allows. Records what the gate is, and that the job name is a required check, since renaming it blocks every pull request.
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.
Every source file with a dedicated test now has exactly one test file, and the merge of a pull
request is gated on the tests passing.
One test file per source
Five sources had their tests split across two files. The second becomes a
@Nestedgroupinside the first:
NearestNeighborSearchIndexExtraTestNearestNeighborSearchIndexTestSignatureIndexOnSequencesTestSignatureIndexTestTermIndexOnSequencesTestTermIndexTestNamespaceConfigAccessorsTestNamespaceConfigTestMetaFilterAccessorsTestMetaFilterTestNesting rather than merging matters for the first three: each pair defines its own
DELTA,configand other helpers, and a nested group keeps its own fixtures instead of forcing thetwo sets to be reconciled.
662 tests pass, against 663 before. The one test lost is a
MetaFiltercase asserting exactlywhat another case already asserted.
What keeps its own file, and why
These test a contract across implementations rather than one class, which is the exception the
structure allows:
SparseEndToEndTest,SparseHybridEndToEndTest,CrossStructureFloorTestare end to end.IndexPairingMatrixTestandIndexEdgeCasesTestexercise every index type against theIndexcontract.SparseComparatorTestandSequenceComparatorTestcover two comparators each, and severalof their cases assert on both at once, so splitting them would cut those cases in half.
ShardedTermIndexTestcovers sharding, which lives inBaseInvertedIndexrather than in aclass of its own.
ErrorClassesTestcovers six error classes in 38 lines.Merging is now gated on the tests
mainhad no protection at all, so anything could be pushed straight to it. It now requirestest on ubuntu-latestandtest on macos-latestto pass before a merge, and that applies toadministrators too. Force pushes and branch deletion are disabled. Branches are not required to
be up to date with main first, so a passing branch does not need rebasing every time main
moves; say if you want that too.