Skip to content

Commit 82fead9

Browse files
wenytang-msCopilot
andcommitted
ci(e2e-autotest): add Linux to the runner matrix
The e2e-test job was hard-coded to `runs-on: windows-latest` even though the autotest framework and the platformMap in this workflow were already written to be OS-aware. This change wires the matrix axis through so we exercise every plan on both Windows and Linux on every PR / schedule run. Changes: * matrix.os = [windows-latest, ubuntu-latest]; runs-on uses it * JDK 25 step is now cross-platform pwsh (junction on Windows, symlink to /opt/jdk-25 on Linux, plus an in-place rewrite of the Windows-style java.jdt.ls.java.home in the java25 plan) * New `Setup virtual display (Linux)` step installs xvfb and exports DISPLAY=:99 before the autotest CLI launches VS Code (the autotest framework does not spawn Xvfb itself) * Artifact name suffix: results-<plan>-<os> so Windows and Linux results don't collide * analyze.organize-results: preserve the <plan>-<os> suffix so the aggregate report keeps Windows and Linux runs distinct Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5ec3f2b commit 82fead9

1 file changed

Lines changed: 34 additions & 6 deletions

File tree

.github/workflows/e2e-autotest.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,12 @@ jobs:
8888
needs: [discover, build-pack]
8989
# build-pack is skipped on schedule/workflow_dispatch — only require it on PRs
9090
if: ${{ always() && needs.discover.result == 'success' && (github.event_name != 'pull_request' || needs.build-pack.result == 'success') }}
91-
runs-on: windows-latest
91+
runs-on: ${{ matrix.os }}
9292
timeout-minutes: 30
9393
strategy:
9494
fail-fast: false
9595
matrix:
96+
os: [windows-latest, ubuntu-latest]
9697
plan: ${{ fromJson(needs.discover.outputs.matrix) }}
9798

9899
steps:
@@ -117,11 +118,24 @@ jobs:
117118
distribution: temurin
118119
java-version: 25-ea
119120

120-
- name: Create JDK 25 path
121+
- name: Configure JDK 25 path for runner OS
121122
if: contains(matrix.plan, 'java25')
122123
shell: pwsh
123124
run: |
124-
New-Item -ItemType Junction -Path "C:\Program Files\Java\jdk-25" -Target $env:JAVA_HOME
125+
$planFile = "test-plans/${{ matrix.plan }}.yaml"
126+
if ($IsWindows) {
127+
$target = "C:\Program Files\Java\jdk-25"
128+
New-Item -ItemType Junction -Path $target -Target $env:JAVA_HOME -Force | Out-Null
129+
Write-Host "Created junction: $target -> $env:JAVA_HOME"
130+
} else {
131+
$target = "/opt/jdk-25"
132+
sudo ln -sfn $env:JAVA_HOME $target
133+
Write-Host "Created symlink: $target -> $env:JAVA_HOME"
134+
# Linux: rewrite the Windows-style java.home setting in the plan
135+
# so the language server resolves JDK 25 on this runner.
136+
(Get-Content $planFile -Raw) -replace 'C:\\\\Program Files\\\\Java\\\\jdk-25', $target | Set-Content $planFile
137+
Write-Host "Patched $planFile java.jdt.ls.java.home -> $target"
138+
}
125139
126140
- name: Setup Java 21
127141
uses: actions/setup-java@v4
@@ -132,6 +146,17 @@ jobs:
132146
- name: Install autotest CLI
133147
run: npm install -g @vscjava/vscode-autotest
134148

149+
- name: Setup virtual display (Linux)
150+
if: runner.os == 'Linux'
151+
shell: bash
152+
run: |
153+
sudo apt-get update
154+
sudo apt-get install -y xvfb
155+
Xvfb :99 -screen 0 1920x1080x24 &
156+
echo "DISPLAY=:99" >> "$GITHUB_ENV"
157+
# Give Xvfb a moment to start before the autotest CLI launches VS Code.
158+
sleep 2
159+
135160
- name: Download PR VSIX (vscode-java-pack from branch)
136161
if: ${{ github.event_name == 'pull_request' }}
137162
uses: actions/download-artifact@v4
@@ -217,7 +242,7 @@ jobs:
217242
if: always()
218243
uses: actions/upload-artifact@v4
219244
with:
220-
name: results-${{ matrix.plan }}
245+
name: results-${{ matrix.plan }}-${{ matrix.os }}
221246
path: test-results/
222247
retention-days: 30
223248

@@ -246,10 +271,13 @@ jobs:
246271
- name: Organize results
247272
run: |
248273
mkdir -p test-results
274+
# Each artifact is named results-<plan>-<os>; keep that suffix so
275+
# Windows and Linux runs of the same plan don't collide.
249276
for dir in all-results/results-*/; do
277+
artifact=$(basename "$dir") # results-<plan>-<os>
278+
suffix="${artifact#results-}" # <plan>-<os>
250279
find "$dir" -name "results.json" -exec dirname {} \; | while read d; do
251-
name=$(basename "$d")
252-
cp -r "$d" "test-results/$name"
280+
cp -r "$d" "test-results/$suffix"
253281
done
254282
done
255283
echo "Organized results:"

0 commit comments

Comments
 (0)