Skip to content

Commit 37571ca

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 37571ca

9 files changed

Lines changed: 1347 additions & 260 deletions

File tree

.github/workflows/ci.yaml

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

.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)