TOOLS-4263 Convert the last legacy JS test to Go and remove the legacy CI - #1172
Conversation
…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.
This was referenced Aug 25, 2026
Collaborator
Author
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.

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.goalready hadTestRoundTripLimitandTestRoundTripSortAndSkip, but both sort on a single ascending key and use one of--skipor--limitrather 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 withexpected: 5, actual: 4. Sorting onaalone 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
aas well asb, neither of which the JS did. It drops the JS test'sassert.eq(0, c.count())precondition becauseBeforeTestinintegration/sharedsuite/suite.godrops 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.shranjstests/tool/*.js, which was this one file, andlib/run_mongod.jswas the harness it loaded.scripts/run-legacy-tests.shand therun legacy testsfunction incommon.yml- deleted, along with the tenlegacy-jstests-*task definitions and thetest_pathexpansion that only fed them. Buildvariants select these tasks by version tag, so no buildvariant task list changes.!.no-raceexclusions in therhel88-racevariant's task list, and the comment explaining them. Those ten tasks carried the onlyno-racetags in the file, so the selectors became no-ops.evergreen validatewarns about the unmatched criteria if they are left behind.github_pr_aliasesentry forrhel88dropslegacy, inaliases()inevergreen/evergreen.goand in the generated block incommon.ymlboth.TestGitHubPRAliasBlockIsUpToDatecompares the two, so they have to move together.test/shell_common/stays. It is not legacy-test infrastructure:scripts/create-repl-set.shandscripts/create-sharded-cluster.shloadload_libs-<VERSION>.jsand the vendoredReplSetTest/ShardingTestfrom it to build the clusters the integration tests run against, andload_libs_versionis still passed to both. The comments in those files that assumed the shell runs fromtest/legacy42are updated to describe the jsconfigbaseUrlthat actually resolves their import paths, and the "Adjust load libs" section ofserver-version-support.mdis rewritten for the same reason - it described the shims as serving the legacy JS tests.