Conversation
This was referenced Jul 16, 2026
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
autarch
changed the base branch from
07-16-tools-4263_delete_js_tests_fully_covered_by_existing_go_tests
to
graphite-base/1047
July 16, 2026 20:35
autarch
force-pushed
the
graphite-base/1047
branch
from
July 16, 2026 20:35
75c4e40 to
926381b
Compare
autarch
force-pushed
the
07-16-tools-4263_add_a_go_test_that_we_preserve_indexes_when_restoring_with_a_non-admin_user_on_a_per-data_basis
branch
from
July 16, 2026 20:35
882c120 to
2a490be
Compare
autarch
force-pushed
the
07-16-tools-4263_add_a_go_test_that_we_preserve_indexes_when_restoring_with_a_non-admin_user_on_a_per-data_basis
branch
from
July 17, 2026 18:57
2a490be to
ae8464d
Compare
autarch
force-pushed
the
07-16-tools-4263_add_a_go_test_that_we_preserve_indexes_when_restoring_with_a_non-admin_user_on_a_per-data_basis
branch
from
July 23, 2026 13:44
ae8464d to
ad7bb15
Compare
autarch
force-pushed
the
07-16-tools-4263_add_a_go_test_that_we_preserve_indexes_when_restoring_with_a_non-admin_user_on_a_per-data_basis
branch
from
July 24, 2026 16:40
ad7bb15 to
e95e844
Compare
autarch
marked this pull request as ready for review
July 24, 2026 16:42
autarch
requested review from
mmcclimon and
tdq45gj
and removed request for
a team and
tdq45gj
July 24, 2026 16:42
mmcclimon
approved these changes
Jul 27, 2026
mmcclimon
left a comment
Collaborator
There was a problem hiding this comment.
Sure, ok with me. I think the test the JS test does isn't exactly covered with the existing Go tests, though, because it does a dump on an unauth cluster and first tries to restore it with an auth cluster. Maybe we don't need to test that, though; I'll leave it up to you.
| t.Cleanup(cleanup) | ||
|
|
||
| ctx := context.Background() | ||
| for i := 0; i < 4; i++ { |
Collaborator
There was a problem hiding this comment.
Suggested change
| for i := 0; i < 4; i++ { | |
| for i := range 4 { |
(nit)
autarch
force-pushed
the
07-16-tools-4263_add_a_go_test_that_we_preserve_indexes_when_restoring_with_a_non-admin_user_on_a_per-data_basis
branch
from
July 27, 2026 21:17
e95e844 to
26fdca5
Compare
autarch
force-pushed
the
07-16-tools-4263_add_a_go_test_that_we_preserve_indexes_when_restoring_with_a_non-admin_user_on_a_per-data_basis
branch
from
August 5, 2026 21:16
26fdca5 to
7b47697
Compare
Collaborator
Author
|
I updated this to add something that tests that restoring without auth fails when auth is enabled. That seems like the most important thing that was missing. |
autarch
force-pushed
the
07-16-tools-4263_add_a_go_test_that_we_preserve_indexes_when_restoring_with_a_non-admin_user_on_a_per-data_basis
branch
from
August 5, 2026 21:43
7b47697 to
6f5d3a5
Compare
This was referenced Aug 5, 2026
Collaborator
Author
… a non-admin user on a per-data basis
autarch
force-pushed
the
07-16-tools-4263_add_a_go_test_that_we_preserve_indexes_when_restoring_with_a_non-admin_user_on_a_per-data_basis
branch
from
August 6, 2026 19:53
6f5d3a5 to
bcc6d55
Compare
autarch
deleted the
07-16-tools-4263_add_a_go_test_that_we_preserve_indexes_when_restoring_with_a_non-admin_user_on_a_per-data_basis
branch
August 6, 2026 19:54
This was referenced Aug 6, 2026
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.

Adds
TestRestoreWithDBUserPreservesIndexesinmongorestore/dumprestore_auth_test.go, whichcloses the last coverage gap in
restorewithauth.jsso that JS test can be deleted.JS -> Go mapping:
test/legacy42/jstests/tool/restorewithauth.js->TestDumpRestoreEnforcesAuthRoles(mongorestore/dumprestore_auth_test.go, pre-existing) +TestRestoreWithDBUserPreservesIndexes(mongorestore/dumprestore_auth_test.go, new in this PR)The JS test covered two things against an auth-enabled server. The first — that dump and restore fail without adequate roles and succeed with them — is already covered by
TestDumpRestoreEnforcesAuthRoles. The second was not covered: that a user holding onlyreadWriteon a single database can restore that database and its secondary indexes come back.TestRestoreWithDBUserPreservesIndexescreates two collections (one with a secondary index onx), dumps and restores them as a per-databasereadWriteuser, and asserts both the documents and the index count are restored.