TOOLS-4148 Convert test/qa-tests/jstests/import/mongoimport mode.js to Go#960
Conversation
Collaborator
Author
test/qa-tests/jstests/import/mongoimport mode.js to Go
e7bccdc to
71cdaf9
Compare
6fa9170 to
4aeb078
Compare
71cdaf9 to
14528f8
Compare
4aeb078 to
14b8dcc
Compare
14b8dcc to
fdfe9f4
Compare
14528f8 to
22fc798
Compare
Adds TestImportModes covering all --mode / --upsertFields combinations
from jstests/import/mode.js.
Notable implementation details:
- Table-driven with importModeCase struct; wantErrContains checks
specific error substrings via require.ErrorContains rather than just
require.Error
- runImportOpts helper returns errors from New() (unlike
importWithIngestOpts which uses require.NoError), enabling error-path
test cases for invalid option combinations
- writeJSONLinesFile marshals []map[string]any to newline-separated JSON
instead of hard-coding string literals
- map[string]any decode results must be reset to map[string]any{} between
FindOne/Decode calls; stale keys from a previous decode persist
otherwise (bug found via test failure)
22fc798 to
c8a35cb
Compare
fdfe9f4 to
66c6cd4
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.

Adds TestImportModes covering all --mode / --upsertFields combinations
from jstests/import/mode.js.
Notable implementation details:
specific error substrings via require.ErrorContains rather than just
require.Error
importWithIngestOpts which uses require.NoError), enabling error-path
test cases for invalid option combinations
instead of hard-coding string literals
FindOne/Decode calls; stale keys from a previous decode persist
otherwise (bug found via test failure)