Skip to content

Commit cee52f9

Browse files
authored
chore(ci): fix vscode test MONGOSH-2422 (#2564)
1 parent 1153fa8 commit cee52f9

File tree

5 files changed

+41
-25
lines changed

5 files changed

+41
-25
lines changed

.evergreen.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4105,16 +4105,18 @@ functions:
41054105
working_dir: src
41064106
shell: bash
41074107
env:
4108-
NODE_JS_VERSION: ${node_js_version}
41094108
DOCKERHUB_USERNAME: ${dockerhub_username}
41104109
DOCKERHUB_PASSWORD: ${dockerhub_password}
41114110
script: |
41124111
set -e
41134112
{
41144113
source .evergreen/setup-env.sh
4115-
(cd scripts/docker && docker build -t ubuntu22.04-xvfb -f ubuntu22.04-xvfb.Dockerfile .)
4114+
# Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable
4115+
export NODE_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]' || echo "22.20.0")
4116+
echo "Using Node.js version for VS Code extension tests: $NODE_VERSION"
4117+
(cd scripts/docker && docker build --build-arg NODE_JS_VERSION="$NODE_VERSION" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .)
41164118
docker run \
4117-
--rm -v $PWD:/tmp/build ubuntu22.04-xvfb \
4119+
--rm -v $PWD:/tmp/build ubuntu24.04-xvfb \
41184120
-c 'cd /tmp/build && ./testing/test-vscode.sh'
41194121
}
41204122
test_connectivity:
@@ -6046,7 +6048,6 @@ tasks:
60466048
node_js_version: "20.19.5"
60476049
- func: test_vscode
60486050
vars:
6049-
node_js_version: "20.19.5"
60506051
task_name: ${task_name}
60516052
- name: test_connectivity
60526053
tags: ["extra-integration-test", "assigned_to_jira_team_mongosh_mongosh"]
@@ -12458,6 +12459,8 @@ buildvariants:
1245812459
display_name: "Ubuntu 20.04 x64 (Other Tests)"
1245912460
run_on: ubuntu2004-small
1246012461
tags: ["nightly-driver"]
12462+
expansions:
12463+
node_js_version: "20.19.5"
1246112464
tasks:
1246212465
- name: test_vscode
1246312466
- name: test_connectivity

.evergreen/evergreen.yml.in

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,16 +324,18 @@ functions:
324324
working_dir: src
325325
shell: bash
326326
env:
327-
NODE_JS_VERSION: ${node_js_version}
328327
DOCKERHUB_USERNAME: ${dockerhub_username}
329328
DOCKERHUB_PASSWORD: ${dockerhub_password}
330329
script: |
331330
set -e
332331
{
333332
source .evergreen/setup-env.sh
334-
(cd scripts/docker && docker build -t ubuntu22.04-xvfb -f ubuntu22.04-xvfb.Dockerfile .)
333+
# Fetch Node.js version from VS Code's .nvmrc, default to 22.20.0 if unavailable
334+
export NODE_VERSION=$(curl -fsSL https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/.nvmrc | tr -d '[:space:]' || echo "22.20.0")
335+
echo "Using Node.js version for VS Code extension tests: $NODE_VERSION"
336+
(cd scripts/docker && docker build --build-arg NODE_JS_VERSION="$NODE_VERSION" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .)
335337
docker run \
336-
--rm -v $PWD:/tmp/build ubuntu22.04-xvfb \
338+
--rm -v $PWD:/tmp/build ubuntu24.04-xvfb \
337339
-c 'cd /tmp/build && ./testing/test-vscode.sh'
338340
}
339341
test_connectivity:
@@ -1189,7 +1191,6 @@ tasks:
11891191
node_js_version: "<% out(NODE_JS_VERSION_20) %>"
11901192
- func: test_vscode
11911193
vars:
1192-
node_js_version: "<% out(NODE_JS_VERSION_20) %>"
11931194
task_name: ${task_name}
11941195
- name: test_connectivity
11951196
tags: ["extra-integration-test", "assigned_to_jira_team_mongosh_mongosh"]
@@ -1611,6 +1612,8 @@ buildvariants:
16111612
display_name: "Ubuntu 20.04 x64 (Other Tests)"
16121613
run_on: ubuntu2004-small
16131614
tags: ["nightly-driver"]
1615+
expansions:
1616+
node_js_version: "<% out(NODE_JS_VERSION_20) %>"
16141617
tasks:
16151618
- name: test_vscode
16161619
- name: test_connectivity

scripts/docker/ubuntu22.04-xvfb.Dockerfile

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM ubuntu:24.04
2+
3+
ARG NODE_JS_VERSION
4+
5+
RUN if [ -z "$NODE_JS_VERSION" ]; then echo "Error: NODE_JS_VERSION is not defined"; exit 1; fi
6+
7+
ENV NODE_JS_VERSION=${NODE_JS_VERSION}
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
RUN apt-get update
10+
RUN apt-get -y -qq install git curl apt-transport-https ca-certificates apt-utils software-properties-common
11+
12+
# Install Node.js using nvm (reusing pattern from .evergreen/install-node.sh)
13+
ENV NVM_DIR="/root/.nvm"
14+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash && \
15+
. "$NVM_DIR/nvm.sh" && \
16+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \
17+
nvm install --no-progress $NODE_JS_VERSION && \
18+
nvm alias default $NODE_JS_VERSION && \
19+
nvm use $NODE_JS_VERSION
20+
# Set PATH so node/npm are available in all contexts
21+
ENV PATH="$NVM_DIR/versions/node/v${NODE_JS_VERSION}/bin:$PATH"
22+
23+
# Install vscode dependencies
24+
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
25+
26+
ENTRYPOINT [ "bash" ]

testing/test-vscode.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ rm -rf node_modules/@mongosh node_modules/mongodb node_modules/@mongodb-js/devto
2121
ln -s "$mongosh_root_dir/node_modules/@mongodb-js/devtools-connect" devtools-connect && \
2222
ln -s "$mongosh_root_dir/node_modules/@mongodb-js/devtools-proxy-support" devtools-proxy-support)
2323
# This test can require a lot of memory so we bump the maximum size.
24-
NODE_OPTIONS=--max-old-space-size=4096 npm test
24+
NODE_OPTIONS='--max-old-space-size=4096 --no-experimental-strip-types' npm test
2525
cd /tmp
2626
rm -rf "$test_root_dir"

0 commit comments

Comments
 (0)