Skip to content

Commit 2bb0c7b

Browse files
committed
Refactoring testing scripts
1 parent ceca482 commit 2bb0c7b

File tree

6 files changed

+655
-118
lines changed

6 files changed

+655
-118
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dist
1010
.gradle
1111
gradle-local.properties
1212
results/
13+
coverage/
1314
test-app/.gradle
1415
test-app/build
1516
test-app/docker

CONTRIBUTING.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,17 @@ cd server
5252
npm install
5353
cd ..
5454
```
55+
5556
A shorthand script that does all of that for you is
5657
```
5758
npm run installAll
5859
```
5960

61+
If you want to ensure a clean build, this command clears all transitory files
62+
```
63+
npm run cleanAll
64+
```
65+
6066
## Using the Extension from the Project (except the debugger)
6167
It is recommended to use VSCode as the editor for this package, as it can self-load a debug instance.
6268

@@ -194,18 +200,22 @@ Note that the order of priority for setting the property values in the test code
194200

195201

196202
### Testing from the command line
197-
Run these two npm scripts from the command line in the root directory of the project to execute the tests. Note that VSCode must not be running while you run the tests.
203+
Run these three npm scripts from the command line in the root directory of the project to execute the tests. Note that VSCode must not be running while you run the tests.
204+
198205
```
199-
npm run installAll
200206
npm run test
201207
npm run testServer
202-
code --extensionDevelopmentPath=<mlxprs-project-dir>/client --extensionTestsPath=<mlxprs-project-dir>/dist/test/integration/index
208+
npm run testIntegration
203209
```
204-
<mark>The final test (the integration tests), should not be run while VSCode is open.</mark>
205210

206-
To ensure a clean build, you may also run this npm script before running the `installAll` script.
211+
Alternatively all tests may be run via the single command:
207212
```
208-
npm run cleanAll
213+
npm run testAll
214+
```
215+
216+
Additionally, test coverage reports may be generated with this command:
217+
```
218+
npm run coverageAll
209219
```
210220

211221
### Proxy testing
@@ -219,6 +229,7 @@ will then forward requests to port 8020 based on the custom mappings.
219229
```
220230
./gradlew runBlockingReverseProxyServer
221231
```
232+
222233
Node Client Test-App Reverse Proxy Mappings
223234
```
224235
"/mlxprs/manage" => port 8059

client/test/runIntegrationTest.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,15 @@ async function main(): Promise<void> {
2929
const extensionTestsPath = path.resolve(__dirname, './integration/index');
3030

3131
// Download VS Code, unzip it and run the integration test
32-
await runTests({ extensionDevelopmentPath, extensionTestsPath });
32+
await runTests(
33+
{
34+
extensionDevelopmentPath,
35+
extensionTestsPath,
36+
launchArgs: [
37+
'--disable-extensions'
38+
]
39+
}
40+
);
3341
} catch (err) {
3442
console.error('Failed to run tests');
3543
process.exit(1);

client/test/suite/client.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,12 @@ cts.doc(cts.uris().toArray()[12 + 19])
228228

229229
test('When a debug configuration is requested, but the pathToCa setting points to an unreadable file', async () => {
230230
ConfigurationManager.setOverride('pathToCa', '/not/an/existing/file');
231+
ConfigurationManager.setOverride('authType', 'BASIC');
231232

232233
const response = await (new XqyDebugConfigurationProvider()).resolveDebugConfiguration(undefined, new XqyDebugConfiguration(), null);
233234
assert.strictEqual(response, undefined, 'the request should return <undefined>');
234235
ConfigurationManager.setOverride('pathToCa', null);
236+
ConfigurationManager.setOverride('authType', null);
235237
});
236238

237239
});

0 commit comments

Comments
 (0)