Skip to content

TOOLS-4263 Convert the last legacy JS test to Go and remove the legacy CI - #1172

Draft
autarch wants to merge 1 commit into
08-24-tools-4263_convert_the_last_two_js_tests_to_go_and_remove_the_qa-tests_cifrom
08-25-tools-4263_convert_the_last_legacy_js_test_to_go_and_remove_the_legacy_ci
Draft

TOOLS-4263 Convert the last legacy JS test to Go and remove the legacy CI#1172
autarch wants to merge 1 commit into
08-24-tools-4263_convert_the_last_two_js_tests_to_go_and_remove_the_qa-tests_cifrom
08-25-tools-4263_convert_the_last_legacy_js_test_to_go_and_remove_the_legacy_ci

Conversation

@autarch

@autarch autarch commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator
  • test/legacy42/jstests/tool/exportimport6.js -> integration/exportimport/query_test.go - TestRoundTripSortSkipAndLimit. Six documents are exported with --sort "{a:1, b:-1}" --skip 4 --limit 1, the collection is dropped, and the export is imported back. Exactly one document survives, and it is a=3,b=5.

query_test.go already had TestRoundTripLimit and TestRoundTripSortAndSkip, but both sort on a single ascending key and use one of --skip or --limit rather than both. The compound sort is what this adds: with a descending second key, a=3,b=5 is the only correct answer, and flipping that key to ascending makes the test fail with expected: 5, actual: 4. Sorting on a alone would leave the two a=3 documents in either order, so an export that dropped the second key would be flaky here rather than reliably wrong.

The Go test also asserts the export and import counts, and asserts a as well as b, neither of which the JS did. It drops the JS test's assert.eq(0, c.count()) precondition because BeforeTest in integration/sharedsuite/suite.go drops every non-system database before each test method, so an empty collection is structural rather than something to check.

No JS tests remain in this repo.

Removes the legacy CI infrastructure, which now has nothing to run:

  • test/legacy42/ - deleted. scripts/run-legacy-tests.sh ran jstests/tool/*.js, which was this one file, and lib/run_mongod.js was the harness it loaded.
  • scripts/run-legacy-tests.sh and the run legacy tests function in common.yml - deleted, along with the ten legacy-jstests-* task definitions and the test_path expansion that only fed them. Buildvariants select these tasks by version tag, so no buildvariant task list changes.
  • The !.no-race exclusions in the rhel88-race variant's task list, and the comment explaining them. Those ten tasks carried the only no-race tags in the file, so the selectors became no-ops. evergreen validate warns about the unmatched criteria if they are left behind.
  • The github_pr_aliases entry for rhel88 drops legacy, in aliases() in evergreen/evergreen.go and in the generated block in common.yml both. TestGitHubPRAliasBlockIsUpToDate compares the two, so they have to move together.

test/shell_common/ stays. It is not legacy-test infrastructure: scripts/create-repl-set.sh and scripts/create-sharded-cluster.sh load load_libs-<VERSION>.js and the vendored ReplSetTest/ShardingTest from it to build the clusters the integration tests run against, and load_libs_version is still passed to both. The comments in those files that assumed the shell runs from test/legacy42 are updated to describe the jsconfig baseUrl that actually resolves their import paths, and the "Adjust load libs" section of server-version-support.md is rewritten for the same reason - it described the shims as serving the legacy JS tests.

…y CI

- `test/legacy42/jstests/tool/exportimport6.js` -> `integration/exportimport/query_test.go` - `TestRoundTripSortSkipAndLimit`. Six documents are exported with `--sort "{a:1, b:-1}" --skip 4 --limit 1`, the collection is dropped, and the export is imported back. Exactly one document survives, and it is a=3,b=5.

`query_test.go` already had `TestRoundTripLimit` and `TestRoundTripSortAndSkip`, but both sort on a single ascending key and use one of `--skip` or `--limit` rather than both. The compound sort is what this adds: with a descending second key, a=3,b=5 is the only correct answer, and flipping that key to ascending makes the test fail with `expected: 5, actual: 4`. Sorting on `a` alone would leave the two a=3 documents in either order, so an export that dropped the second key would be flaky here rather than reliably wrong.

The Go test also asserts the export and import counts, and asserts `a` as well as `b`, neither of which the JS did. It drops the JS test's `assert.eq(0, c.count())` precondition because `BeforeTest` in `integration/sharedsuite/suite.go` drops every non-system database before each test method, so an empty collection is structural rather than something to check.

No JS tests remain in this repo.

Removes the legacy CI infrastructure, which now has nothing to run:

- `test/legacy42/` - deleted. `scripts/run-legacy-tests.sh` ran `jstests/tool/*.js`, which was this one file, and `lib/run_mongod.js` was the harness it loaded.
- `scripts/run-legacy-tests.sh` and the `run legacy tests` function in `common.yml` - deleted, along with the ten `legacy-jstests-*` task definitions and the `test_path` expansion that only fed them. Buildvariants select these tasks by version tag, so no buildvariant task list changes.
- The `!.no-race` exclusions in the `rhel88-race` variant's task list, and the comment explaining them. Those ten tasks carried the only `no-race` tags in the file, so the selectors became no-ops. `evergreen validate` warns about the unmatched criteria if they are left behind.
- The `github_pr_aliases` entry for `rhel88` drops `legacy`, in `aliases()` in `evergreen/evergreen.go` and in the generated block in `common.yml` both. `TestGitHubPRAliasBlockIsUpToDate` compares the two, so they have to move together.

`test/shell_common/` stays. It is not legacy-test infrastructure: `scripts/create-repl-set.sh` and `scripts/create-sharded-cluster.sh` load `load_libs-<VERSION>.js` and the vendored `ReplSetTest`/`ShardingTest` from it to build the clusters the integration tests run against, and `load_libs_version` is still passed to both. The comments in those files that assumed the shell runs from `test/legacy42` are updated to describe the jsconfig `baseUrl` that actually resolves their import paths, and the "Adjust load libs" section of `server-version-support.md` is rewritten for the same reason - it described the shims as serving the legacy JS tests.

autarch commented Aug 25, 2026

Copy link
Copy Markdown
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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

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