Skip to content

TOOLS-4263 Convert mongorestore invalid-input tests to Go#1046

Draft
autarch wants to merge 1 commit into
07-16-tools-4263_delete_js_tests_fully_covered_by_existing_go_testsfrom
07-16-tools-4263_convert_mongorestore_invalid-input_tests_to_go
Draft

TOOLS-4263 Convert mongorestore invalid-input tests to Go#1046
autarch wants to merge 1 commit into
07-16-tools-4263_delete_js_tests_fully_covered_by_existing_go_testsfrom
07-16-tools-4263_convert_mongorestore_invalid-input_tests_to_go

Conversation

@autarch

@autarch autarch commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

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 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator Author

@autarch
autarch force-pushed the 07-16-tools-4263_convert_mongorestore_invalid-input_tests_to_go branch from 4fe13c9 to a8f11cc Compare July 16, 2026 20:27
@autarch
autarch force-pushed the 07-16-tools-4263_delete_js_tests_fully_covered_by_existing_go_tests branch from 75c4e40 to eef4eab Compare July 16, 2026 20:35
@autarch
autarch force-pushed the 07-16-tools-4263_convert_mongorestore_invalid-input_tests_to_go branch from a8f11cc to ae94bd6 Compare July 16, 2026 20:35
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
autarch force-pushed the 07-16-tools-4263_convert_mongorestore_invalid-input_tests_to_go branch from ae94bd6 to ef8ebd0 Compare July 17, 2026 18:57
@autarch
autarch force-pushed the 07-16-tools-4263_delete_js_tests_fully_covered_by_existing_go_tests branch from eef4eab to 47590df Compare July 17, 2026 18:57
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