TOOLS-4263 Convert mongorestore invalid-input tests to Go#1046
Draft
Conversation
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
autarch
force-pushed
the
07-16-tools-4263_convert_mongorestore_invalid-input_tests_to_go
branch
from
July 16, 2026 20:27
4fe13c9 to
a8f11cc
Compare
autarch
force-pushed
the
07-16-tools-4263_delete_js_tests_fully_covered_by_existing_go_tests
branch
from
July 16, 2026 20:35
75c4e40 to
eef4eab
Compare
autarch
force-pushed
the
07-16-tools-4263_convert_mongorestore_invalid-input_tests_to_go
branch
from
July 16, 2026 20:35
a8f11cc to
ae94bd6
Compare
This adds a new `TestRestoreInvalidInput` test in `mongorestore/invalid_input_test.go`. This covers a number of cases for mongorestore's handling of invalid input options.
It replaces many JS tests:
- bad_options.js -> "option validation" subtests: --objcheck
with --noobjcheck, malformed --oplogLimit,
negative --writeConcern, invalid --db,
invalid --collection. (The -v verbosity
case is omitted: it exercises shared
common/options code, not mongorestore.)
- missing_dump.js -> "missing dump target" subtests (missing
dir, missing dir with --db, missing bson
file with --collection)
- invalid_dump_target.js -> "invalid dump target" subtests (file where
a dir is expected, with and without --db;
dir where a bson file is expected)
- malformed_bson.js -> "malformed bson file errors"
- malformed_metadata.js -> "malformed metadata file errors"
- invalid_metadata.js -> "invalid index in metadata errors"
- blank_collection_bson.js -> "blank collection bson" subtests (with and
without a metadata file)
- blank_db.js -> "blank db directory succeeds"
- objcheck_valid_bson.js -> "objcheck succeeds on valid bson"
- oplog_replay_no_oplog.js -> "oplogReplay with no oplog file errors"
autarch
force-pushed
the
07-16-tools-4263_convert_mongorestore_invalid-input_tests_to_go
branch
from
July 17, 2026 18:57
ae94bd6 to
ef8ebd0
Compare
autarch
force-pushed
the
07-16-tools-4263_delete_js_tests_fully_covered_by_existing_go_tests
branch
from
July 17, 2026 18:57
eef4eab to
47590df
Compare
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.

This adds a new
TestRestoreInvalidInputtest inmongorestore/invalid_input_test.go. This covers a number of cases for mongorestore's handling of invalid input options.It replaces many JS tests:
with --noobjcheck, malformed --oplogLimit,
negative --writeConcern, invalid --db,
invalid --collection. (The -v verbosity
case is omitted: it exercises shared
common/options code, not mongorestore.)
dir, missing dir with --db, missing bson
file with --collection)
a dir is expected, with and without --db;
dir where a bson file is expected)
without a metadata file)