TOOLS-4263 Convert CSV and TSV round trip tests to Go - #1131
Draft
autarch wants to merge 1 commit into
Conversation
This was referenced Aug 20, 2026
Collaborator
Author
This was referenced Aug 20, 2026
autarch
force-pushed
the
08-11-tools-4263_convert_csv_and_tsv_round_trip_tests_to_go
branch
from
August 25, 2026 15:30
65f84e6 to
8ec5e61
Compare
autarch
force-pushed
the
08-11-tools-4263_convert_mongodump_auth_profile_dump_test_to_go
branch
from
August 25, 2026 15:30
8ce9918 to
82d5ce4
Compare
This was referenced Aug 25, 2026
Starts phase 4 of the JS test migration, moving the delimited-text export and import tests into integration/exportimport. * test/legacy42/jstests/tool/csv1.js -> integration/exportimport/csv_test.go - a CSV round trip of values holding commas and embedded double quotes, and of a field name holding a space * test/legacy42/jstests/tool/csvimport1.js -> integration/exportimport/csv_test.go - CSV import of newlines inside quoted cells, doubled quotes, backslashes, empty cells, and padding around quoted cells * test/legacy42/jstests/tool/tsv1.js -> integration/exportimport/csv_test.go - TSV import with --fields and with --headerline * test/legacy42/jstests/tool/csvexport1.js -> integration/exportimport/csv_test.go - CSV export formatting of ObjectId, MinKey, BinData, date, Timestamp, regex and JavaScript values The two data files under test/legacy42/jstests/tool/data go too. Only these tests read them, so their contents are now consts in the Go test, byte for byte including the whitespace around the quoted cells that the parser has to strip. Each import test asserts the whole resulting document rather than a count, and runs twice: once with --fields, where the header row has to import as ordinary data, and once with --headerline, where it has to be consumed. The export test asserts the exact text of every exported cell, which the JS could not do because it only compared documents after importing the export back. It then imports that text back as well, so both halves of what the JS covered are still covered.
autarch
force-pushed
the
08-11-tools-4263_convert_mongodump_auth_profile_dump_test_to_go
branch
from
August 25, 2026 20:18
82d5ce4 to
e668a2a
Compare
autarch
force-pushed
the
08-11-tools-4263_convert_csv_and_tsv_round_trip_tests_to_go
branch
from
August 25, 2026 20:18
8ec5e61 to
5260f99
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.

Starts phase 4 of the JS test migration, moving the delimited-text export and
import tests into integration/exportimport.
The two data files under test/legacy42/jstests/tool/data go too. Only these
tests read them, so their contents are now consts in the Go test, byte for byte
including the whitespace around the quoted cells that the parser has to strip.
Each import test asserts the whole resulting document rather than a count, and
runs twice: once with --fields, where the header row has to import as ordinary
data, and once with --headerline, where it has to be consumed. The export test
asserts the exact text of every exported cell, which the JS could not do because
it only compared documents after importing the export back. It then imports that
text back as well, so both halves of what the JS covered are still covered.