TOOLS-4263 Convert mongodump query and data behavior tests to Go - #1102
Draft
Conversation
This was referenced Aug 10, 2026
Collaborator
Author
autarch
force-pushed
the
08-07-tools-4263_convert_mongodump_flag_validation_tests_to_go
branch
from
August 11, 2026 16:19
671c518 to
8b86f2f
Compare
autarch
force-pushed
the
08-10-tools-4263_convert_mongodump_query_and_data_behavior_tests_to_go
branch
from
August 11, 2026 16:19
1608c62 to
5c2f350
Compare
autarch
force-pushed
the
08-07-tools-4263_convert_mongodump_flag_validation_tests_to_go
branch
from
August 11, 2026 17:11
8b86f2f to
6e08784
Compare
autarch
force-pushed
the
08-10-tools-4263_convert_mongodump_query_and_data_behavior_tests_to_go
branch
from
August 11, 2026 17:11
5c2f350 to
3642200
Compare
autarch
force-pushed
the
08-07-tools-4263_convert_mongodump_flag_validation_tests_to_go
branch
from
August 12, 2026 18:46
6e08784 to
30437f1
Compare
autarch
force-pushed
the
08-10-tools-4263_convert_mongodump_query_and_data_behavior_tests_to_go
branch
from
August 12, 2026 18:46
3642200 to
da91c0a
Compare
autarch
force-pushed
the
08-10-tools-4263_convert_mongodump_query_and_data_behavior_tests_to_go
branch
from
August 20, 2026 15:41
da91c0a to
33cbdf2
Compare
autarch
force-pushed
the
08-07-tools-4263_convert_mongodump_flag_validation_tests_to_go
branch
from
August 20, 2026 15:41
30437f1 to
27e94fa
Compare
This was referenced Aug 20, 2026
This was referenced Aug 20, 2026
Adds `integration/dumprestore/dump_behaviors_test.go`, extends `TestMongoDumpValidateOptions` (`mongodump/mongodump_test.go`) and `TestReadDumpServerVersionFromArchive` (`mongorestore/mongorestore_archive_test.go`), and deletes the four JS tests they replace. JS -> Go mapping: - `test/qa-tests/jstests/dump/query_extended_json.js` -> `TestDumpExtendedJSONQuery` (`integration/dumprestore/dump_behaviors_test.go`) - a `--query` written in extended JSON reaches the server as the BSON type it denotes rather than as the document it looks like, covered table-driven over `$date`, `$regularExpression`, `$oid`, `$minKey` and `$maxKey`. Each case inserts one document the query should match and one it should not, and asserts the matched value comes back as the named BSON type; the JS only counted survivors, which a query parsed as the wrong type could satisfy. - `test/qa-tests/jstests/dump/force_table_scan_tests.js` -> `TestDumpForceTableScan` (`integration/dumprestore/dump_behaviors_test.go`) and the "forceTableScan together with a query" case of `TestMongoDumpValidateOptions` (`mongodump/mongodump_test.go`) - dumping with `--forceTableScan` while documents are inserted concurrently succeeds, and because the dump uses no index and takes no snapshot the result is only bounded: it holds at least what existed when the dump started, and strictly fewer than exist once the inserts are stopped. The strict upper bound is the point -- it is what shows the dump read the collection while it was still growing, and it is why the background inserts run for the whole duration of the dump rather than seeding a fixed number of documents up front. This is the first coverage of the flag, including that it cannot be combined with `--query`. - `test/qa-tests/jstests/dump/options_json.js` -> `TestDumpStorageEngineOptions` (`integration/dumprestore/dump_behaviors_test.go`) - a collection created with storage-engine options round-trips with those options intact. The JS checked only exit codes and would have passed had the options been silently dropped, so this captures the options the server reports before the dump and asserts they are identical afterwards. - `test/qa-tests/jstests/dump/version_test.js` -> `TestReadDumpServerVersionFromArchive` (`mongorestore/mongorestore_archive_test.go`) - the archive format, server and tool versions read out of the prelude are reported in the restore's log. The restore needs `-vvv` for those lines to be emitted at all, because `ParseOptions` calls `log.SetVerbosity` with the options it parsed and so resets the verbosity the package's `init()` raised.
autarch
force-pushed
the
08-07-tools-4263_convert_mongodump_flag_validation_tests_to_go
branch
from
August 25, 2026 15:30
27e94fa to
846f023
Compare
autarch
force-pushed
the
08-10-tools-4263_convert_mongodump_query_and_data_behavior_tests_to_go
branch
from
August 25, 2026 15:30
33cbdf2 to
119d96e
Compare
This was referenced Aug 25, 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
integration/dumprestore/dump_behaviors_test.go, extendsTestMongoDumpValidateOptions(mongodump/mongodump_test.go) andTestReadDumpServerVersionFromArchive(mongorestore/mongorestore_archive_test.go), and deletes the four JS tests they replace.JS -> Go mapping:
test/qa-tests/jstests/dump/query_extended_json.js->TestDumpExtendedJSONQuery(integration/dumprestore/dump_behaviors_test.go) - a--querywritten in extended JSON reaches the server as the BSON type it denotes rather than as the document it looks like, covered table-driven over$date,$regularExpression,$oid,$minKeyand$maxKey. Each case inserts one document the query should match and one it should not, and asserts the matched value comes back as the named BSON type; the JS only counted survivors, which a query parsed as the wrong type could satisfy.test/qa-tests/jstests/dump/force_table_scan_tests.js->TestDumpForceTableScan(integration/dumprestore/dump_behaviors_test.go) and the "forceTableScan together with a query" case ofTestMongoDumpValidateOptions(mongodump/mongodump_test.go) - dumping with--forceTableScanwhile documents are inserted concurrently succeeds, and because the dump uses no index and takes no snapshot the result is only bounded: it holds at least what existed when the dump started and at most what existed when it finished. This is the first coverage of the flag, including that it cannot be combined with--query.test/qa-tests/jstests/dump/options_json.js->TestDumpStorageEngineOptions(integration/dumprestore/dump_behaviors_test.go) - a collection created with storage-engine options round-trips with those options intact. The JS checked only exit codes and would have passed had the options been silently dropped, so this captures the options the server reports before the dump and asserts they are identical afterwards.test/qa-tests/jstests/dump/version_test.js->TestReadDumpServerVersionFromArchive(mongorestore/mongorestore_archive_test.go) - the archive format, server and tool versions read out of the prelude are reported in the restore's log. The restore needs-vvvfor those lines to be emitted at all, becauseParseOptionscallslog.SetVerbositywith the options it parsed and so resets the verbosity the package'sinit()raised.