Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4105,16 +4105,18 @@ functions:
working_dir: src
shell: bash
env:
NODE_JS_VERSION: ${node_js_version}
DOCKERHUB_USERNAME: ${dockerhub_username}
DOCKERHUB_PASSWORD: ${dockerhub_password}
script: |
set -e
{
source .evergreen/setup-env.sh
(cd scripts/docker && docker build -t ubuntu22.04-xvfb -f ubuntu22.04-xvfb.Dockerfile .)
# Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable
export NODE_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]' || echo "22.20.0")
echo "Using Node.js version for VS Code extension tests: $NODE_VERSION"
(cd scripts/docker && docker build --build-arg NODE_JS_VERSION="$NODE_VERSION" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .)
docker run \
--rm -v $PWD:/tmp/build ubuntu22.04-xvfb \
--rm -v $PWD:/tmp/build ubuntu24.04-xvfb \
-c 'cd /tmp/build && ./testing/test-vscode.sh'
}
test_connectivity:
Expand Down Expand Up @@ -6046,7 +6048,6 @@ tasks:
node_js_version: "20.19.5"
- func: test_vscode
vars:
node_js_version: "20.19.5"
task_name: ${task_name}
- name: test_connectivity
tags: ["extra-integration-test", "assigned_to_jira_team_mongosh_mongosh"]
Expand Down Expand Up @@ -12458,6 +12459,8 @@ buildvariants:
display_name: "Ubuntu 20.04 x64 (Other Tests)"
run_on: ubuntu2004-small
tags: ["nightly-driver"]
expansions:
node_js_version: "20.19.5"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is VSCode still on this? I imagine we'd actually want a more recent one that roughly matches what VSCode uses

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VSCode is pretty slow at adopting Node but the latest one is actually now on 22.19.0, so I can try this 👍

tasks:
- name: test_vscode
- name: test_connectivity
Expand Down
11 changes: 7 additions & 4 deletions .evergreen/evergreen.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,18 @@ functions:
working_dir: src
shell: bash
env:
NODE_JS_VERSION: ${node_js_version}
DOCKERHUB_USERNAME: ${dockerhub_username}
DOCKERHUB_PASSWORD: ${dockerhub_password}
script: |
set -e
{
source .evergreen/setup-env.sh
(cd scripts/docker && docker build -t ubuntu22.04-xvfb -f ubuntu22.04-xvfb.Dockerfile .)
# Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable
export NODE_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]' || echo "22.20.0")
echo "Using Node.js version for VS Code extension tests: $NODE_VERSION"
(cd scripts/docker && docker build --build-arg NODE_JS_VERSION="$NODE_VERSION" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .)
docker run \
--rm -v $PWD:/tmp/build ubuntu22.04-xvfb \
--rm -v $PWD:/tmp/build ubuntu24.04-xvfb \
-c 'cd /tmp/build && ./testing/test-vscode.sh'
}
test_connectivity:
Expand Down Expand Up @@ -1189,7 +1191,6 @@ tasks:
node_js_version: "<% out(NODE_JS_VERSION_20) %>"
- func: test_vscode
vars:
node_js_version: "<% out(NODE_JS_VERSION_20) %>"
task_name: ${task_name}
- name: test_connectivity
tags: ["extra-integration-test", "assigned_to_jira_team_mongosh_mongosh"]
Expand Down Expand Up @@ -1611,6 +1612,8 @@ buildvariants:
display_name: "Ubuntu 20.04 x64 (Other Tests)"
run_on: ubuntu2004-small
tags: ["nightly-driver"]
expansions:
node_js_version: "<% out(NODE_JS_VERSION_20) %>"
tasks:
- name: test_vscode
- name: test_connectivity
Expand Down
16 changes: 0 additions & 16 deletions scripts/docker/ubuntu22.04-xvfb.Dockerfile

This file was deleted.

26 changes: 26 additions & 0 deletions scripts/docker/ubuntu24.04-xvfb.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:24.04

ARG NODE_JS_VERSION

RUN if [ -z "$NODE_JS_VERSION" ]; then echo "Error: NODE_JS_VERSION is not defined"; exit 1; fi

ENV NODE_JS_VERSION=${NODE_JS_VERSION}
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get -y -qq install git curl apt-transport-https ca-certificates apt-utils software-properties-common

# Install Node.js using nvm (reusing pattern from .evergreen/install-node.sh)
ENV NVM_DIR="/root/.nvm"
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash && \
. "$NVM_DIR/nvm.sh" && \
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \
nvm install --no-progress $NODE_JS_VERSION && \
nvm alias default $NODE_JS_VERSION && \
nvm use $NODE_JS_VERSION
# Set PATH so node/npm are available in all contexts
ENV PATH="$NVM_DIR/versions/node/v${NODE_JS_VERSION}/bin:$PATH"

# Install vscode dependencies
RUN apt-get -y -qq install libnss3 gnupg libxkbfile1 libsecret-1-0 libsecret-1-dev libgtk-3-0t64 libxss1 libgbm1 libasound2t64 xvfb build-essential pkg-config

ENTRYPOINT [ "bash" ]
2 changes: 1 addition & 1 deletion testing/test-vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ rm -rf node_modules/@mongosh node_modules/mongodb node_modules/@mongodb-js/devto
ln -s "$mongosh_root_dir/node_modules/@mongodb-js/devtools-connect" devtools-connect && \
ln -s "$mongosh_root_dir/node_modules/@mongodb-js/devtools-proxy-support" devtools-proxy-support)
# This test can require a lot of memory so we bump the maximum size.
NODE_OPTIONS=--max-old-space-size=4096 npm test
NODE_OPTIONS='--max-old-space-size=4096 --no-experimental-strip-types' npm test
cd /tmp
rm -rf "$test_root_dir"