Skip to content

TOOLS-4278 Convert mongorestore_test.go index tests to testify - #1082

Draft
autarch wants to merge 1 commit into
TOOLS-4278-convey-to-testify-mongorestore-main-1from
TOOLS-4278-convey-to-testify-mongorestore-main-2a
Draft

TOOLS-4278 Convert mongorestore_test.go index tests to testify#1082
autarch wants to merge 1 commit into
TOOLS-4278-convey-to-testify-mongorestore-main-1from
TOOLS-4278-convey-to-testify-mongorestore-main-2a

Conversation

@autarch

@autarch autarch commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Converts seven Test* functions, from TestMongorestoreMIOSOE through
TestReadPreludeMetadata. TestFixHashedIndexes onward stays on GoConvey
for now, so the dot-import remains.

Assertion sites drop from 108 to 94. Both reductions are static only.
TestReadPreludeMetadata's seven near-identical blocks become one table,
which is 17 sites down to 5 while still running the same 29 assertions.
TestDeprecatedIndexOptions loses two setup sites to a per-subtest helper:
GoConvey re-ran the outer block per leaf, so each leaf built the other
leaf's restore instance as well as its own.

The helper's cleanup deletes with context.Background(), since t.Context()
is cancelled before cleanups run, and asserts with assert rather than
require so a failing drop doesn't skip the cleanups registered before it.

MIOSOE's ShouldAlmostEqual becomes InDelta, and the duplicated-index
prefix check becomes strings.HasPrefix.

No behavior change.

Converts seven Test* functions, from TestMongorestoreMIOSOE through
TestReadPreludeMetadata. TestFixHashedIndexes onward stays on GoConvey
for now, so the dot-import remains.

Assertion sites drop from 108 to 94. Both reductions are static only.
TestReadPreludeMetadata's seven near-identical blocks become one table,
which is 17 sites down to 5 while still running the same 29 assertions.
TestDeprecatedIndexOptions loses two setup sites to a per-subtest helper:
GoConvey re-ran the outer block per leaf, so each leaf built the other
leaf's restore instance as well as its own.

The helper's cleanup deletes with context.Background(), since t.Context()
is cancelled before cleanups run, and asserts with assert rather than
require so a failing drop doesn't skip the cleanups registered before it.

MIOSOE's ShouldAlmostEqual becomes InDelta, and the duplicated-index
prefix check becomes strings.HasPrefix.

No behavior change.

autarch commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@autarch

autarch commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Retitled from "Convert mongorestore index and metadata tests" to name the file, because #1078 earlier in the stack is titled "…metadata and archive tests" and covers metadata_test.go — two different files, near-identical titles.

The commit message still carries the original wording; only the PR title changed, to avoid another force-push across the branches above this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant