From a55b3db9771b107305e42f7cd44308011d245618 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 12:54:55 +0100 Subject: [PATCH 01/18] chore(ci): fix vscode test --- .evergreen.yml | 4 ++-- .evergreen/evergreen.yml.in | 4 ++-- scripts/docker/ubuntu24.04-xvfb.Dockerfile | 23 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 scripts/docker/ubuntu24.04-xvfb.Dockerfile diff --git a/.evergreen.yml b/.evergreen.yml index 4cd885d65d..c1cb97abbd 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4112,9 +4112,9 @@ functions: set -e { source .evergreen/setup-env.sh - (cd scripts/docker && docker build -t ubuntu22.04-xvfb -f ubuntu22.04-xvfb.Dockerfile .) + (cd scripts/docker && docker build --build-arg NODE_JS_VERSION=${NODE_JS_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: diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index b3d3ddfbde..29853fb0a8 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -331,9 +331,9 @@ functions: set -e { source .evergreen/setup-env.sh - (cd scripts/docker && docker build -t ubuntu22.04-xvfb -f ubuntu22.04-xvfb.Dockerfile .) + (cd scripts/docker && docker build --build-arg NODE_JS_VERSION=${NODE_JS_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: diff --git a/scripts/docker/ubuntu24.04-xvfb.Dockerfile b/scripts/docker/ubuntu24.04-xvfb.Dockerfile new file mode 100644 index 0000000000..269dd961bd --- /dev/null +++ b/scripts/docker/ubuntu24.04-xvfb.Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:24.04 + +ARG 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" ] From 845f27b2ce200d7961bdb65fabb9fe41c64aa8cf Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 12:57:06 +0100 Subject: [PATCH 02/18] chore: delete the 22.04 file --- scripts/docker/ubuntu22.04-xvfb.Dockerfile | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 scripts/docker/ubuntu22.04-xvfb.Dockerfile diff --git a/scripts/docker/ubuntu22.04-xvfb.Dockerfile b/scripts/docker/ubuntu22.04-xvfb.Dockerfile deleted file mode 100644 index ce599c03d9..0000000000 --- a/scripts/docker/ubuntu22.04-xvfb.Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM ubuntu:22.04 - -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 - -# Add Node.js -RUN curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - -RUN echo "deb https://deb.nodesource.com/node_20.x jammy main" | tee /etc/apt/sources.list.d/nodesource.list -RUN echo "deb-src https://deb.nodesource.com/node_20.x jammy main" | tee -a /etc/apt/sources.list.d/nodesource.list - -# Install Node.js and vscode dependencies -RUN apt-get update -RUN apt-get -y -qq install nodejs libnss3 gnupg libxkbfile1 libsecret-1-0 libsecret-1-dev libgtk-3-0 libxss1 libgbm1 libasound2 xvfb build-essential pkg-config - -ENTRYPOINT [ "bash" ] From 2bb714f730c713820e0117a2864241d0b354bce8 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 13:19:53 +0100 Subject: [PATCH 03/18] chore: fix build --- scripts/docker/ubuntu24.04-xvfb.Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/docker/ubuntu24.04-xvfb.Dockerfile b/scripts/docker/ubuntu24.04-xvfb.Dockerfile index 269dd961bd..7b05f28051 100644 --- a/scripts/docker/ubuntu24.04-xvfb.Dockerfile +++ b/scripts/docker/ubuntu24.04-xvfb.Dockerfile @@ -1,6 +1,7 @@ FROM ubuntu:24.04 ARG NODE_JS_VERSION +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 @@ -14,8 +15,11 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | b 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" +# Set PATH source nvm in interactive shells +RUN echo 'export PATH="$NVM_DIR/versions/node/v'"$NODE_JS_VERSION"'/bin:$PATH"' >> /root/.bashrc && \ + echo 'export PATH="$NVM_DIR/versions/node/v'"$NODE_JS_VERSION"'/bin:$PATH"' >> /root/.profile && \ + echo '. "$NVM_DIR/nvm.sh"' >> /root/.bashrc && \ + echo '. "$NVM_DIR/nvm.sh"' >> /root/.profile # 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 From 90b7e7dc3edbce028a98af3cf9d87a27cee8dcaa Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 13:23:24 +0100 Subject: [PATCH 04/18] chore: fix setup --- scripts/docker/ubuntu24.04-xvfb.Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/docker/ubuntu24.04-xvfb.Dockerfile b/scripts/docker/ubuntu24.04-xvfb.Dockerfile index 7b05f28051..9e6ab1102e 100644 --- a/scripts/docker/ubuntu24.04-xvfb.Dockerfile +++ b/scripts/docker/ubuntu24.04-xvfb.Dockerfile @@ -15,11 +15,8 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | b nvm alias default $NODE_JS_VERSION && \ nvm use $NODE_JS_VERSION -# Set PATH source nvm in interactive shells -RUN echo 'export PATH="$NVM_DIR/versions/node/v'"$NODE_JS_VERSION"'/bin:$PATH"' >> /root/.bashrc && \ - echo 'export PATH="$NVM_DIR/versions/node/v'"$NODE_JS_VERSION"'/bin:$PATH"' >> /root/.profile && \ - echo '. "$NVM_DIR/nvm.sh"' >> /root/.bashrc && \ - echo '. "$NVM_DIR/nvm.sh"' >> /root/.profile +# 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 From 9baae5e4265e342d50449098cd576624ebd42be8 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 13:38:41 +0100 Subject: [PATCH 05/18] chore: remove setup env --- .evergreen.yml | 1 - .evergreen/evergreen.yml.in | 1 - scripts/docker/ubuntu24.04-xvfb.Dockerfile | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.evergreen.yml b/.evergreen.yml index c1cb97abbd..c6acbdfc34 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4111,7 +4111,6 @@ functions: script: | set -e { - source .evergreen/setup-env.sh (cd scripts/docker && docker build --build-arg NODE_JS_VERSION=${NODE_JS_VERSION} -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \ diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index 29853fb0a8..5e92c0262b 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -330,7 +330,6 @@ functions: script: | set -e { - source .evergreen/setup-env.sh (cd scripts/docker && docker build --build-arg NODE_JS_VERSION=${NODE_JS_VERSION} -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \ diff --git a/scripts/docker/ubuntu24.04-xvfb.Dockerfile b/scripts/docker/ubuntu24.04-xvfb.Dockerfile index 9e6ab1102e..f38ffb0f79 100644 --- a/scripts/docker/ubuntu24.04-xvfb.Dockerfile +++ b/scripts/docker/ubuntu24.04-xvfb.Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:24.04 -ARG NODE_JS_VERSION +ARG NODE_JS_VERSION=20.19.5 ENV NODE_JS_VERSION=${NODE_JS_VERSION} ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update From 17738f830be0ffcf2d7431fac3438cdb4fc52030 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 13:51:30 +0100 Subject: [PATCH 06/18] chore: pass the node version --- .evergreen.yml | 2 ++ .evergreen/evergreen.yml.in | 2 ++ scripts/docker/ubuntu24.04-xvfb.Dockerfile | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.evergreen.yml b/.evergreen.yml index c6acbdfc34..0eb6861cb6 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -12459,6 +12459,8 @@ buildvariants: tags: ["nightly-driver"] tasks: - name: test_vscode + vars: + NODE_JS_VERSION: "20.19.5" - name: test_connectivity - name: test_apistrict - name: linux_coverage diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index 5e92c0262b..c4a3cd628d 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -1612,6 +1612,8 @@ buildvariants: tags: ["nightly-driver"] tasks: - name: test_vscode + vars: + NODE_JS_VERSION: "<% out(NODE_JS_VERSION_20) %>" - name: test_connectivity - name: test_apistrict - name: linux_coverage diff --git a/scripts/docker/ubuntu24.04-xvfb.Dockerfile b/scripts/docker/ubuntu24.04-xvfb.Dockerfile index f38ffb0f79..9e6ab1102e 100644 --- a/scripts/docker/ubuntu24.04-xvfb.Dockerfile +++ b/scripts/docker/ubuntu24.04-xvfb.Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:24.04 -ARG NODE_JS_VERSION=20.19.5 +ARG NODE_JS_VERSION ENV NODE_JS_VERSION=${NODE_JS_VERSION} ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update From 9def5bbfc6a8e02c1870c349bb5863a82b79c6cc Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 13:53:24 +0100 Subject: [PATCH 07/18] chore: use expansions --- .evergreen.yml | 4 ++-- .evergreen/evergreen.yml.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.evergreen.yml b/.evergreen.yml index 0eb6861cb6..d535b41505 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -12457,10 +12457,10 @@ buildvariants: display_name: "Ubuntu 20.04 x64 (Other Tests)" run_on: ubuntu2004-small tags: ["nightly-driver"] + expansions: + node_js_version: "20.19.5" tasks: - name: test_vscode - vars: - NODE_JS_VERSION: "20.19.5" - name: test_connectivity - name: test_apistrict - name: linux_coverage diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index c4a3cd628d..b3dd711f46 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -1610,10 +1610,10 @@ 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 - vars: - NODE_JS_VERSION: "<% out(NODE_JS_VERSION_20) %>" - name: test_connectivity - name: test_apistrict - name: linux_coverage From 513e8bd9432a2e0431a5dfa7872ad414840a443a Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 14:18:48 +0100 Subject: [PATCH 08/18] chore: pass env explicitly? --- .evergreen.yml | 3 ++- .evergreen/evergreen.yml.in | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.evergreen.yml b/.evergreen.yml index d535b41505..bfe65279fd 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4111,7 +4111,8 @@ functions: script: | set -e { - (cd scripts/docker && docker build --build-arg NODE_JS_VERSION=${NODE_JS_VERSION} -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) + echo "Using Node.js version: ${NODE_JS_VERSION}" + (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \ -c 'cd /tmp/build && ./testing/test-vscode.sh' diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index b3dd711f46..2791b4cd88 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -330,7 +330,8 @@ functions: script: | set -e { - (cd scripts/docker && docker build --build-arg NODE_JS_VERSION=${NODE_JS_VERSION} -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) + echo "Using Node.js version: ${NODE_JS_VERSION}" + (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \ -c 'cd /tmp/build && ./testing/test-vscode.sh' From 21367c54edf3e16cccd6999040987e71589ea008 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 15:38:20 +0100 Subject: [PATCH 09/18] chore: use Node 22.19.0 --- .evergreen.yml | 5 +++-- .evergreen/evergreen.yml.in | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.evergreen.yml b/.evergreen.yml index bfe65279fd..57954a1d85 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4105,7 +4105,9 @@ functions: working_dir: src shell: bash env: - NODE_JS_VERSION: ${node_js_version} + # Node version used by VSCode 1.105.1 + # TODO: Look into automatically getting this for the latest version. + NODE_JS_VERSION: "22.19.0" DOCKERHUB_USERNAME: ${dockerhub_username} DOCKERHUB_PASSWORD: ${dockerhub_password} script: | @@ -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"] diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index 2791b4cd88..b14f1286fe 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -324,7 +324,9 @@ functions: working_dir: src shell: bash env: - NODE_JS_VERSION: ${node_js_version} + # Node version used by VSCode 1.105.1 + # TODO: Look into automatically getting this for the latest version. + NODE_JS_VERSION: "22.19.0" DOCKERHUB_USERNAME: ${dockerhub_username} DOCKERHUB_PASSWORD: ${dockerhub_password} script: | @@ -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"] From 72afe476515df6c5569dd326af0ee2cccf1b5b22 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 15:43:16 +0100 Subject: [PATCH 10/18] chore: set the latest VSCode node version to be based on the VSCode repo --- .evergreen.yml | 7 +++---- .evergreen/evergreen.yml.in | 7 +++---- scripts/docker/ubuntu24.04-xvfb.Dockerfile | 19 +++++++++++-------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.evergreen.yml b/.evergreen.yml index 57954a1d85..2284b96e1a 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4105,15 +4105,14 @@ functions: working_dir: src shell: bash env: - # Node version used by VSCode 1.105.1 - # TODO: Look into automatically getting this for the latest version. - NODE_JS_VERSION: "22.19.0" DOCKERHUB_USERNAME: ${dockerhub_username} DOCKERHUB_PASSWORD: ${dockerhub_password} script: | set -e { - echo "Using Node.js version: ${NODE_JS_VERSION}" + # Fetch Node.js version from VS Code's .nvmrc to ensure we test with the same version + NODE_JS_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]') + echo "Using Node.js version from VS Code .nvmrc: ${NODE_JS_VERSION}" (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \ diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index b14f1286fe..f6320a33bd 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -324,15 +324,14 @@ functions: working_dir: src shell: bash env: - # Node version used by VSCode 1.105.1 - # TODO: Look into automatically getting this for the latest version. - NODE_JS_VERSION: "22.19.0" DOCKERHUB_USERNAME: ${dockerhub_username} DOCKERHUB_PASSWORD: ${dockerhub_password} script: | set -e { - echo "Using Node.js version: ${NODE_JS_VERSION}" + # Fetch Node.js version from VS Code's .nvmrc to ensure we test with the same version + NODE_JS_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]') + echo "Using Node.js version from VS Code .nvmrc: ${NODE_JS_VERSION}" (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \ diff --git a/scripts/docker/ubuntu24.04-xvfb.Dockerfile b/scripts/docker/ubuntu24.04-xvfb.Dockerfile index 9e6ab1102e..ec5b113055 100644 --- a/scripts/docker/ubuntu24.04-xvfb.Dockerfile +++ b/scripts/docker/ubuntu24.04-xvfb.Dockerfile @@ -1,22 +1,25 @@ FROM ubuntu:24.04 -ARG NODE_JS_VERSION -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) +# Install Node.js using nvm with version from VS Code's .nvmrc +# This ensures we test with the same Node.js version that VS Code uses 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 + NODE_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]') && \ + echo "Installing Node.js version from VS Code .nvmrc: $NODE_VERSION" && \ + nvm install --no-progress $NODE_VERSION && \ + nvm alias default $NODE_VERSION && \ + nvm use $NODE_VERSION && \ + echo "export NVM_DIR=\"$NVM_DIR\"" >> /root/.bashrc && \ + echo "export PATH=\"$NVM_DIR/versions/node/v${NODE_VERSION}/bin:\$PATH\"" >> /root/.bashrc -# Set PATH so node/npm are available in all contexts -ENV PATH="$NVM_DIR/versions/node/v${NODE_JS_VERSION}/bin:$PATH" +# Set PATH so node/npm are available in all contexts (using wildcard since we don't know the version at Docker ENV time) +RUN bash -c ". $NVM_DIR/nvm.sh && ln -sf \$(which node) /usr/local/bin/node && ln -sf \$(which npm) /usr/local/bin/npm" # 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 From 3c44e68a276c001f11c89a16005b314ffd998aad Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 15:47:20 +0100 Subject: [PATCH 11/18] chore: simplify dockerfile --- scripts/docker/ubuntu24.04-xvfb.Dockerfile | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/scripts/docker/ubuntu24.04-xvfb.Dockerfile b/scripts/docker/ubuntu24.04-xvfb.Dockerfile index ec5b113055..9bb77eece8 100644 --- a/scripts/docker/ubuntu24.04-xvfb.Dockerfile +++ b/scripts/docker/ubuntu24.04-xvfb.Dockerfile @@ -1,25 +1,21 @@ FROM ubuntu:24.04 +ARG NODE_JS_VERSION +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 with version from VS Code's .nvmrc -# This ensures we test with the same Node.js version that VS Code uses +# 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" && \ - NODE_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]') && \ - echo "Installing Node.js version from VS Code .nvmrc: $NODE_VERSION" && \ - nvm install --no-progress $NODE_VERSION && \ - nvm alias default $NODE_VERSION && \ - nvm use $NODE_VERSION && \ - echo "export NVM_DIR=\"$NVM_DIR\"" >> /root/.bashrc && \ - echo "export PATH=\"$NVM_DIR/versions/node/v${NODE_VERSION}/bin:\$PATH\"" >> /root/.bashrc - -# Set PATH so node/npm are available in all contexts (using wildcard since we don't know the version at Docker ENV time) -RUN bash -c ". $NVM_DIR/nvm.sh && ln -sf \$(which node) /usr/local/bin/node && ln -sf \$(which npm) /usr/local/bin/npm" + 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 From feb6fc81c10be596a67665901465411988bab69c Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 16:26:14 +0100 Subject: [PATCH 12/18] chore: fallback if curl call fails --- .evergreen/evergreen.yml.in | 6 +++--- scripts/docker/ubuntu24.04-xvfb.Dockerfile | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index f6320a33bd..dea56d539c 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -329,9 +329,9 @@ functions: script: | set -e { - # Fetch Node.js version from VS Code's .nvmrc to ensure we test with the same version - NODE_JS_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]') - echo "Using Node.js version from VS Code .nvmrc: ${NODE_JS_VERSION}" + # Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable + NODE_JS_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_JS_VERSION}" (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \ diff --git a/scripts/docker/ubuntu24.04-xvfb.Dockerfile b/scripts/docker/ubuntu24.04-xvfb.Dockerfile index 9bb77eece8..0ce7d46a86 100644 --- a/scripts/docker/ubuntu24.04-xvfb.Dockerfile +++ b/scripts/docker/ubuntu24.04-xvfb.Dockerfile @@ -1,6 +1,9 @@ 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 From 30a5271915f278e491d549be2241def403b805d8 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 16:26:59 +0100 Subject: [PATCH 13/18] chore: update actual config --- .evergreen.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.evergreen.yml b/.evergreen.yml index 2284b96e1a..fc5938857c 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4110,9 +4110,9 @@ functions: script: | set -e { - # Fetch Node.js version from VS Code's .nvmrc to ensure we test with the same version - NODE_JS_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]') - echo "Using Node.js version from VS Code .nvmrc: ${NODE_JS_VERSION}" + # Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable + NODE_JS_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_JS_VERSION}" (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \ From 5a1cd1431ad0bf65b776cb2a8b81e6e8c6ea0f06 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 16:28:15 +0100 Subject: [PATCH 14/18] chore: update evergreen --- .evergreen.yml | 1 + .evergreen/evergreen.yml.in | 1 + 2 files changed, 2 insertions(+) diff --git a/.evergreen.yml b/.evergreen.yml index fc5938857c..b60d8f5b97 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4110,6 +4110,7 @@ functions: script: | set -e { + source .evergreen/setup-env.sh # Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable NODE_JS_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_JS_VERSION}" diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index dea56d539c..e4c85fe677 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -329,6 +329,7 @@ functions: script: | set -e { + source .evergreen/setup-env.sh # Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable NODE_JS_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_JS_VERSION}" From a721e4ae2270da6d3365c2762fd7ddf9ca359f37 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 16:47:07 +0100 Subject: [PATCH 15/18] chore: use export --- .evergreen.yml | 2 +- .evergreen/evergreen.yml.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen.yml b/.evergreen.yml index b60d8f5b97..1633116db2 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4112,7 +4112,7 @@ functions: { source .evergreen/setup-env.sh # Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable - NODE_JS_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]' || echo "22.20.0") + export NODE_JS_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_JS_VERSION}" (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index e4c85fe677..0481f08234 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -331,7 +331,7 @@ functions: { source .evergreen/setup-env.sh # Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable - NODE_JS_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]' || echo "22.20.0") + export NODE_JS_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_JS_VERSION}" (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ From 775ca29001e99eda91f5d75b67e4ff407f18b9f1 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 17:12:46 +0100 Subject: [PATCH 16/18] chore: avoid NODE_JS_VERSION --- .evergreen.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.evergreen.yml b/.evergreen.yml index 1633116db2..d968ef7cb2 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4112,9 +4112,9 @@ functions: { source .evergreen/setup-env.sh # Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable - export NODE_JS_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_JS_VERSION}" - (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) + 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 ubuntu24.04-xvfb \ -c 'cd /tmp/build && ./testing/test-vscode.sh' From 0659eac7a9e766262fbe04ab6d9f1da1fc80b5f5 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 3 Nov 2025 17:24:13 +0100 Subject: [PATCH 17/18] chore: avoid expansion syntax --- .evergreen.yml | 4 ++-- .evergreen/evergreen.yml.in | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.evergreen.yml b/.evergreen.yml index d968ef7cb2..4cfce45453 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4113,8 +4113,8 @@ functions: source .evergreen/setup-env.sh # 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 .) + 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 ubuntu24.04-xvfb \ -c 'cd /tmp/build && ./testing/test-vscode.sh' diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index 0481f08234..349318a047 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -331,9 +331,9 @@ functions: { source .evergreen/setup-env.sh # Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable - export NODE_JS_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_JS_VERSION}" - (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) + 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 ubuntu24.04-xvfb \ -c 'cd /tmp/build && ./testing/test-vscode.sh' From d37eaa4d9392b01dbd59eb3f4cd8575547581d17 Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 4 Nov 2025 11:26:11 +0100 Subject: [PATCH 18/18] chore: add --no-experimental-strip-types --- testing/test-vscode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test-vscode.sh b/testing/test-vscode.sh index 9c97f88c2f..d6b858d4bc 100755 --- a/testing/test-vscode.sh +++ b/testing/test-vscode.sh @@ -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"