Skip to content

Commit 16eb5cb

Browse files
committed
Merge branch 'topic/mocha-tests' into 'master'
Migrate to debugging vscode tests from the vscode UI See merge request eng/ide/ada_language_server!1518
2 parents a390951 + 7f5bb5b commit 16eb5cb

File tree

5 files changed

+14
-116
lines changed

5 files changed

+14
-116
lines changed

.vscode/launch.json

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -38,110 +38,6 @@
3838
"PATH": "${env:PATH}"
3939
}
4040
},
41-
{
42-
"name": "(vscode) Run testsuite 'general'",
43-
"type": "extensionHost",
44-
"request": "launch",
45-
"runtimeExecutable": "${execPath}",
46-
"outFiles": [
47-
"${workspaceFolder}/integration/vscode/ada/out/**/*.js",
48-
"!**/node_modules/**"
49-
],
50-
"args": [
51-
"--extensionDevelopmentPath=${workspaceFolder}/integration/vscode/ada",
52-
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/general/index",
53-
"${workspaceFolder}/integration/vscode/ada/test/workspaces/general"
54-
],
55-
// Below we make the executables of node modules visible to the tests.
56-
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
57-
// tests.
58-
"env": {
59-
"MOCHA_GREP": "${input:testPattern}",
60-
// This is necessary to make the "child" vscode inherit the PATH
61-
// variable set in the workspace settings. Without it in some setups
62-
// (e.g. vscode remote) the child vscode does not get visibility
63-
// over the Ada toolchain available in the parent vscode
64-
// environment.
65-
"PATH": "${env:PATH}",
66-
// This is custom env var that we use in
67-
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
68-
// tests when debugging
69-
"MOCHA_TIMEOUT": "0",
70-
"MOCHA_ALS_UPDATE": "${input:updateTestRefs}"
71-
},
72-
"preLaunchTask": "npm: pretest - integration/vscode/ada",
73-
"internalConsoleOptions": "openOnSessionStart"
74-
},
75-
{
76-
"name": "(vscode) Run testsuite 'gnattest'",
77-
"type": "extensionHost",
78-
"request": "launch",
79-
"runtimeExecutable": "${execPath}",
80-
"outFiles": [
81-
"${workspaceFolder}/integration/vscode/ada/out/**/*.js",
82-
"!**/node_modules/**"
83-
],
84-
"args": [
85-
"--extensionDevelopmentPath=${workspaceFolder}/integration/vscode/ada",
86-
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/gnattest/index",
87-
"${workspaceFolder}/integration/vscode/ada/test/workspaces/gnattest"
88-
],
89-
// Below we make the executables of node modules visible to the tests.
90-
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
91-
// tests.
92-
"env": {
93-
"MOCHA_GREP": "${input:testPattern}",
94-
// This is necessary to make the "child" vscode inherit the PATH
95-
// variable set in the workspace settings. Without it in some setups
96-
// (e.g. vscode remote) the child vscode does not get visibility
97-
// over the Ada toolchain available in the parent vscode
98-
// environment.
99-
"PATH": "${env:PATH}",
100-
// This is custom env var that we use in
101-
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
102-
// tests when debugging
103-
"MOCHA_TIMEOUT": "0",
104-
"MOCHA_ALS_UPDATE": "${input:updateTestRefs}"
105-
},
106-
"preLaunchTask": "npm: pretest - integration/vscode/ada",
107-
// Switch to Debug Console to see test results
108-
"internalConsoleOptions": "openOnSessionStart"
109-
},
110-
{
111-
"name": "(vscode) Run testsuite 'workspace_missing_dirs'",
112-
"type": "extensionHost",
113-
"request": "launch",
114-
"runtimeExecutable": "${execPath}",
115-
"outFiles": [
116-
"${workspaceFolder}/integration/vscode/ada/out/**/*.js",
117-
"!**/node_modules/**"
118-
],
119-
"args": [
120-
"--extensionDevelopmentPath=${workspaceFolder}/integration/vscode/ada",
121-
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/workspace_missing_dirs/index",
122-
"${workspaceFolder}/integration/vscode/ada/test/workspaces/workspace_missing_dirs"
123-
],
124-
// Below we make the executables of node modules visible to the tests.
125-
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
126-
// tests.
127-
"env": {
128-
"MOCHA_GREP": "${input:testPattern}",
129-
// This is necessary to make the "child" vscode inherit the PATH
130-
// variable set in the workspace settings. Without it in some setups
131-
// (e.g. vscode remote) the child vscode does not get visibility
132-
// over the Ada toolchain available in the parent vscode
133-
// environment.
134-
"PATH": "${env:PATH}",
135-
// This is custom env var that we use in
136-
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
137-
// tests when debugging
138-
"MOCHA_TIMEOUT": "0",
139-
"MOCHA_ALS_UPDATE": "${input:updateTestRefs}"
140-
},
141-
"preLaunchTask": "npm: pretest - integration/vscode/ada",
142-
// Switch to Debug Console to see test results
143-
"internalConsoleOptions": "openOnSessionStart"
144-
},
14541
{
14642
"name": "(npm) Launch all vscode tests with npm",
14743
"type": "node",

.vscode/settings.json.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,12 @@
9393
"suite": ["describe", "suite"],
9494
"test": ["it", "test"],
9595
"extractWith": "syntax"
96+
},
97+
"extension-test-runner.debugOptions": {
98+
"outFiles": [
99+
"${workspaceFolder}/integration/vscode/ada/out/**/*.js",
100+
"!**/node_modules/**"
101+
],
102+
"preLaunchTask": "npm: watch - integration/vscode/ada"
96103
}
97104
}

.vscode/tasks.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,6 @@
4545
"clear": true
4646
}
4747
},
48-
{
49-
"type": "npm",
50-
"script": "watch",
51-
"path": "integration/vscode/ada",
52-
"group": "build",
53-
"problemMatcher": ["$tsc-watch"],
54-
"label": "npm: watch - integration/vscode/ada",
55-
"detail": "node ./node_modules/typescript/bin/tsc -watch",
56-
"isBackground": true
57-
},
5848
{
5949
"type": "ada",
6050
"configuration": {

doc/HACKING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Run `make vscode-test` to run the VS Code testsuite.
144144
If you open the ALS repository in VS Code, it is also possible to run VS Code
145145
integration tests using the Testing view.
146146
The `integration/vscode/ada/.vscode-test.mjs` contains a configuration allowing to load the tests in the Testing view.
147-
The UI offers ways to run all or a subset of the tests.
147+
The UI offers ways to run or debug one test, a subset of tests or all tests.
148148
149149
### Other tests
150150

integration/vscode/ada/.vscode-test.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ export default defineConfig(
7878
// now. A workaround is to remove this line.
7979
DISPLAY: ':99',
8080
},
81-
launchArgs: ['--user-data-dir', tmpdir],
81+
launchArgs: [
82+
// It's important to use the --user-data-dir=<path> form. The
83+
// --user-data-dir <path> form sometimes gets <path> considered
84+
// as another workspace root directory.
85+
`--user-data-dir=${tmpdir}`,
86+
],
8287
// Use external installation if provided in the VSCODE env variable
8388
useInstallation: process.env.VSCODE ? { fromPath: process.env.VSCODE } : undefined,
8489
};

0 commit comments

Comments
 (0)