Skip to content

Commit e4c3008

Browse files
committed
Use existing profiles for integration tests
1 parent 4feabb7 commit e4c3008

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

.vscode/launch.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
// Launch VSCode using a specific profile to ensure that user settings are not used.
2121
// This profile must be imported into vscode before running this launch configuration.
2222
// The profile can be found under /test/csharp-standalone-profile.
23-
"--profile csharp-standalone-profile",
23+
"--profile",
24+
"csharp-standalone-profile",
2425
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace",
2526
"--extensionDevelopmentPath=${workspaceRoot}",
2627
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
@@ -44,7 +45,8 @@
4445
// Launch VSCode using a specific profile to ensure that user settings are not used.
4546
// This profile must be imported into vscode before running this launch configuration.
4647
// The profile can be found under /test/csharp-standalone-profile.
47-
"--profile csharp-standalone-profile",
48+
"--profile",
49+
"csharp-standalone-profile",
4850
"${workspaceRoot}/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/lsp_tools_host_BasicRazorApp2_1.code-workspace",
4951
"--extensionDevelopmentPath=${workspaceRoot}",
5052
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests"
@@ -68,7 +70,8 @@
6870
// Launch VSCode using a specific profile to ensure that user settings are not used.
6971
// This profile must be imported into vscode before running this launch configuration.
7072
// The profile can be found under /test/csharp-standalone-profile.
71-
"--profile csharp-standalone-profile",
73+
"--profile",
74+
"csharp-standalone-profile",
7275
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_${input:omnisharpAssetName}.code-workspace",
7376
"--extensionDevelopmentPath=${workspaceRoot}",
7477
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"
@@ -92,7 +95,8 @@
9295
// Launch VSCode using a specific profile to ensure that user settings are not used.
9396
// This profile must be imported into vscode before running this launch configuration.
9497
// The profile can be found under /test/csharp-standalone-profile.
95-
"--profile csharp-standalone-profile",
98+
"--profile",
99+
"csharp-standalone-profile",
96100
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_lsp_${input:omnisharpAssetName}.code-workspace",
97101
"--extensionDevelopmentPath=${workspaceRoot}",
98102
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"

CONTRIBUTING.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,16 @@ After completing the build steps:
5151

5252
#### Testing
5353

54-
To run tests:
54+
To run all tests, execute `npm run test`.
5555

56-
1. Execute `npm run test` or press <kbd>F5</kbd> in VS Code with the "Launch Tests" debug configuration selected.
57-
2. For integration tests, select either of the two 'current file' integration tests (one for roslyn and one for razor), from the drop-down and press <kbd>F5</kbd> to start debugging:
58-
- For Roslyn Server: `Launch Current File slnWithCsproj Integration Tests`
59-
- For Razor Server: `Launch Current File BasicRazorApp2_1 Integration Tests`
56+
To debug unit tests locally, press <kbd>F5</kbd> in VS Code with the "Launch Tests" debug configuration selected.
57+
58+
To debug integration tests
59+
1. Import the `csharp-standalone-profile.code-profile` in VSCode to setup a clean profile in which to run integration tests. This must be imported at least once to use the launch configurations.
60+
2. Open any integration test file and <kbd>F5</kbd> launch with the correct launch configuration selected.
61+
- For integration tests inside `test/lsptoolshost`, use `Launch Current File slnWithCsproj Integration Tests`
62+
- For integration tests inside `test/razor`, use `Launch Current File BasicRazorApp2_1 Integration Tests`
63+
- For integration tests inside `test/omnisharp`, use one of the `Omnisharp:` current file profiles
6064

6165
These will allow you to actually debug the test, but the 'Razor integration tests' configuration does not.
6266

test/lsptoolshost/integrationTests/README.md

Whitespace-only changes.

0 commit comments

Comments
 (0)