Skip to content

Commit 1334cd0

Browse files
committed
Add smoke tests for the binary server
Fixes #1075 This PR includes a smoke test suite for vscode-xml where I check the diagnostic messages of an invalid XML document against an XSD schema in order to make sure that the server starts properly. These tests can be run locally or through CI, and default to using the binary version of lemminx. I also include a GitHub Action that builds the binary server and then runs the smoke test suite against it. This suite is a modified copy of [vscode-lemminx-schematron](https://github.com/datho7561/lemminx-schematron/tree/main/vscode-schematron)'s test suite. Signed-off-by: David Thompson <davthomp@redhat.com>
1 parent 2217325 commit 1334cd0

9 files changed

Lines changed: 1346 additions & 260 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Continuous Integration
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Fix package-lock.json
12+
run: rm package-lock.json
13+
- name: Install dependencies
14+
run: npm i --also=dev
15+
- name: Run TypeScript compiler (under webpack)
16+
run: npm run compile
17+
- name: Run ESLint
18+
run: npm run eslint
19+
20+
build-test-native-image:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
repository: 'eclipse/lemminx'
26+
- uses: graalvm/setup-graalvm@557ffcf459751b4d92319ee255bf3bec9b73964c #v1.2.5
27+
with:
28+
distribution: graalvm-community
29+
java-version: 17
30+
- run: ./mvnw -B package -Dnative -DskipTests -Dgraalvm.static=-H:+StaticExecutableWithDynamicLibC -Dcbi.jarsigner.skip=true
31+
- run: mv org.eclipse.lemminx/target/lemminx-* lemminx-linux
32+
- uses: actions/upload-artifact@v4
33+
with:
34+
name: lemminx-linux
35+
path: lemminx-linux
36+
if-no-files-found: error
37+
38+
smoke-test:
39+
runs-on: ubuntu-latest
40+
needs: build-test-native-image
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: actions/download-artifact@v4
44+
with:
45+
name: lemminx-linux
46+
path: server
47+
- name: Make lemminx binary executable
48+
run: chmod u+x ./server/lemminx-linux
49+
- name: Make lemminx binary trusted
50+
run: sha256sum ./server/lemminx-linux > ./server/lemminx-linux.sha256
51+
- name: Install dependencies
52+
run: npm i --also=dev
53+
- name: Run smoke test suite
54+
run: xvfb-run npm test

.github/workflows/lint.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.vscode-test.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Copyright (c) 2025 Red Hat, Inc. and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v2.0
5+
* which accompanies this distribution, and is available at
6+
* https://www.eclipse.org/legal/epl-v20.html
7+
*
8+
* Contributors:
9+
* Red Hat Inc. - initial API and implementation
10+
*/
11+
import { defineConfig } from '@vscode/test-cli';
12+
13+
export default defineConfig({
14+
files: 'out/src/test/**/*.test.js',
15+
workspaceFolder: 'test-workspace'
16+
});

.vscode/launch.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,6 @@
3838
"VSCODE_REDHAT_TELEMETRY_DEBUG": "true",
3939
"LEMMINX_DEBUG": "1"
4040
}
41-
},
42-
{
43-
"name": "Launch Tests",
44-
"type": "extensionHost",
45-
"request": "launch",
46-
"runtimeExecutable": "${execPath}",
47-
"args": [
48-
"--extensionDevelopmentPath=${workspaceRoot}",
49-
"--extensionTestsPath=${workspaceRoot}/out/test"
50-
],
51-
"sourceMaps": true,
52-
"outFiles": [
53-
"${workspaceRoot}/dist/**/*.js"
54-
],
55-
"preLaunchTask": "npm: watch"
5641
}
5742
]
5843
}

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ images/
1515
.tool-versions
1616
.github/
1717
.gitignore
18+
test-workspace

0 commit comments

Comments
 (0)