Repository navigation
Test Elasticsearch, OpenSearch and MongoDB against every supported major version - #1593
Merged
Merged
Conversation
…ions-search-document
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.
Summary
Another batch of bringing existing modules in line with the supported-versions rule proposed in #1587 (others: #1589, #1591, #1592): a module's tests cover the latest release of every major version the vendor still supports. This one removes tests for versions past end of life.
Each suite now has one
IMAGESlist, oldest major first and theDockerfileimage last, and runs in full against every entry withdescribe.each(IMAGES). The images run one after another and each image's tests run concurrently, as the single-image suite did:{ concurrent: false }ondescribe.each,it.concurrenton the tests. Before, only the first test of each suite ran on the older images.IMAGES7.17.28(7.x EOL 2026-01-15),8.18.1(8.18 EOL 2025-10-21)8.19.23(EOL 2027-07-15);Dockerfileimage (9.5) in the main file2.19.2→2.19.6Dockerfile(3.9)6.0.25(EOL 2025-07-31),4.4.29(EOL 2024-02-29)Dockerfile(9.0)Notes:
elasticsearch-container-v8.test.ts, because it needs its own client. The 9.x@elastic/elasticsearchclient can't talk to Elasticsearch 8 (it sends acompatible-with=9media type and getsmedia_type_header_exceptionon requests with a body), so the 8.x client is added as a dev dependency under the alias@elastic/elasticsearch-8and that file imports it.elasticsearch-container.test.tskeeps theDockerfileimage and the 9.x client. All four tests, including "should index a document", run on both majors. The docs page now lists both client majors, each with the Elasticsearch major it goes with.concurrent: false). Vitest runs the two files in parallel, so with concurrent tests eight Elasticsearch nodes would start at once. Even five at once, as onmain, already takes 114 to 157 s per test on CI against a 180 s timeout, while a test with little else running takes 21 to 50 s. One test per file keeps it to two nodes. Locally the two files together went from 100 s (only the 8 file sequential) to 83 s.mongodb/mongodb-atlas-local:7.0.43, then theDockerfileimage (8.3). The image has no lifecycle page of its own; its tags follow the MongoDB server versions, and 7.0 and 8.x are both still published.The module code that only served the removed MongoDB versions is removed separately in #1597.
Verification
Local, macOS arm64, Docker Desktop. Only the older lines were run locally:
npx vitest run packages/modules/elasticsearchDockerfileimage with the 9.x client. With the 9.x client on 8.19, "should index a document" failed withmedia_type_header_exceptionnpx vitest run packages/modules/opensearch --maxConcurrency=2 -t "2.19.6"npx vitest run packages/modules/mongodb/src/mongodb-container.test.ts --maxConcurrency=2 -t "7.0.43|8.3.11"npm run format,npm run lint,npm run knip: clean.inside_blockmarker used by the three docs pages still resolves to one block.Left to CI: the
Dockerfileimage's share of each loop, Podman, Node 22 and 24, linux/amd64, and the docs build.Container starts per run: elasticsearch 6 → 8, opensearch 6 → 10, mongodb 4 → 6, Atlas Local 6 → 12 (6 passed locally on 7.0.43). Elasticsearch and OpenSearch are the two slowest module jobs, so their CI times are the ones to check here.
Baseline job times on
main(run 38287125470, docker 22 / docker 24 / podman 22 / podman 24, seconds): elasticsearch 166/176/212/185, opensearch 152/169/197/196, mongodb 94/82/123/129.Not breaking
Test files, one docs sentence, and a dev dependency of
@testcontainers/elasticsearch(package-lock.jsonadds only the aliased 8.x client and its own dependencies). No module source, exports orDockerfilechanged.