Skip to content

Commit ba8e118

Browse files
authored
Merge pull request #6554 from dibarbet/omnisharp_integration_jest
Update O# integration tests to use jest
2 parents b2d30a3 + f5a139a commit ba8e118

File tree

185 files changed

+1283
-2447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+1283
-2447
lines changed

.vscode/launch.json

Lines changed: 55 additions & 204 deletions
Original file line numberDiff line numberDiff line change
@@ -44,224 +44,60 @@
4444
"preLaunchTask": "buildDev"
4545
},
4646
{
47-
"type": "node",
48-
"request": "launch",
49-
"name": "Omnisharp: Launch Unit tests",
50-
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
51-
"args": [
52-
"-u",
53-
"tdd",
54-
"--timeout",
55-
"999999",
56-
"--colors",
57-
"${workspaceFolder}/out/omnisharptest/omnisharpUnitTests/**/*.test.js"
58-
],
59-
"sourceMaps": true,
60-
"internalConsoleOptions": "openOnSessionStart",
61-
"outFiles": [
62-
"${workspaceRoot}/out/omnisharptest/**/*.js"
63-
],
64-
"preLaunchTask": "build"
65-
},
66-
{
67-
"name": "Omnisharp: Launch Feature Tests",
47+
"name": "Omnisharp: Launch Current File Integration Tests",
6848
"type": "extensionHost",
6949
"request": "launch",
7050
"runtimeExecutable": "${execPath}",
7151
"args": [
7252
// Create a temp profile that has no extensions / user settings.
7353
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
7454
"--profile-temp",
55+
"${workspaceRoot}/omnisharptest/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_${input:omnisharpAssetName}.code-workspace",
7556
"--extensionDevelopmentPath=${workspaceRoot}",
76-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpFeatureTests"
57+
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests",
7758
],
7859
"env": {
7960
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
80-
"OSVC_SUITE": "featureTests",
81-
},
82-
"sourceMaps": true,
83-
"outFiles": [
84-
"${workspaceRoot}/out/omnisharptest/**/*.js"
85-
],
86-
"preLaunchTask": "build"
87-
},
88-
{
89-
"name": "Omnisharp: Launch singleCsproj Workspace Tests",
90-
"type": "extensionHost",
91-
"request": "launch",
92-
"runtimeExecutable": "${execPath}",
93-
"args": [
94-
// Create a temp profile that has no extensions / user settings.
95-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
96-
"--profile-temp",
97-
"${workspaceRoot}/test/integrationTests/testAssets/singleCsproj/.vscode/omnisharp_singleCsproj.code-workspace",
98-
"--extensionDevelopmentPath=${workspaceRoot}",
99-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
100-
],
101-
"env": {
102-
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
103-
"OSVC_SUITE": "singleCsproj",
104-
},
105-
"sourceMaps": true,
106-
"outFiles": [
107-
"${workspaceRoot}/dist/*.js",
108-
"${workspaceRoot}/out/omnisharptest/**/*.js"
109-
],
110-
"preLaunchTask": "buildDev"
111-
},
112-
{
113-
"name": "Omnisharp: Launch razorcsproj Workspace Tests",
114-
"type": "extensionHost",
115-
"request": "launch",
116-
"runtimeExecutable": "${execPath}",
117-
"args": [
118-
// Create a temp profile that has no extensions / user settings.
119-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
120-
"--profile-temp",
121-
"${workspaceRoot}/test/integrationTests/testAssets/BasicRazorApp2_1",
122-
"--extensionDevelopmentPath=${workspaceRoot}",
123-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
124-
],
125-
"env": {
126-
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
127-
"OSVC_SUITE": "BasicRazorApp2_1",
128-
},
129-
},
130-
{
131-
"name": "Omnisharp: Launch slnWithCsproj Workspace Tests",
132-
"type": "extensionHost",
133-
"request": "launch",
134-
"runtimeExecutable": "${execPath}",
135-
"args": [
136-
// Create a temp profile that has no extensions / user settings.
137-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
138-
"--profile-temp",
139-
"${workspaceRoot}/test/integrationTests/testAssets/slnWithCsproj/.vscode/omnisharp_slnWithCsproj.code-workspace",
140-
"--extensionDevelopmentPath=${workspaceRoot}",
141-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
142-
],
143-
"env": {
144-
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
145-
"OSVC_SUITE": "slnWithCsproj",
146-
},
147-
"sourceMaps": true,
148-
"outFiles": [
149-
"${workspaceRoot}/dist/*.js",
150-
"${workspaceRoot}/out/omnisharptest/**/*.js"
151-
],
152-
"preLaunchTask": "buildDev"
153-
},
154-
{
155-
"name": "Omnisharp: Launch singleCsproj Workspace Tests [LSP]",
156-
"type": "extensionHost",
157-
"request": "launch",
158-
"runtimeExecutable": "${execPath}",
159-
"args": [
160-
// Create a temp profile that has no extensions / user settings.
161-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
162-
"--profile-temp",
163-
"${workspaceRoot}/test/integrationTests/testAssets/singleCsproj/.vscode/omnisharp_lsp_singleCsproj.code-workspace",
164-
"--extensionDevelopmentPath=${workspaceRoot}",
165-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
166-
],
167-
"env": {
168-
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
169-
"OSVC_SUITE": "singleCsproj",
61+
"OSVC_SUITE": "${input:omnisharpAssetName}",
62+
"TEST_FILE_FILTER": "${file}"
17063
},
17164
"sourceMaps": true,
17265
"outFiles": [
17366
"${workspaceRoot}/dist/*.js",
174-
"${workspaceRoot}/out/omnisharptest/**/*.js"
175-
],
176-
"preLaunchTask": "buildDev"
177-
},
178-
{
179-
"name": "Omnisharp: Launch razorcsproj Workspace Tests [LSP]",
180-
"type": "extensionHost",
181-
"request": "launch",
182-
"runtimeExecutable": "${execPath}",
183-
"args": [
184-
// Create a temp profile that has no extensions / user settings.
185-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
186-
"--profile-temp",
187-
"${workspaceRoot}/test/integrationTests/testAssets/BasicRazorApp2_1",
188-
"--extensionDevelopmentPath=${workspaceRoot}",
189-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
190-
],
191-
"env": {
192-
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
193-
"OSVC_SUITE": "BasicRazorApp2_1",
194-
},
195-
},
196-
{
197-
"name": "Omnisharp: Launch slnWithCsproj Workspace Tests [LSP]",
198-
"type": "extensionHost",
199-
"request": "launch",
200-
"runtimeExecutable": "${execPath}",
201-
"args": [
202-
// Create a temp profile that has no extensions / user settings.
203-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
204-
"--profile-temp",
205-
"${workspaceRoot}/test/integrationTests/testAssets/slnWithCsproj/.vscode/omnisharp_lsp_slnWithCsproj.code-workspace",
206-
"--extensionDevelopmentPath=${workspaceRoot}",
207-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
67+
"${workspaceRoot}/out/test/**/*.js"
20868
],
209-
"env": {
210-
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
211-
"OSVC_SUITE": "slnWithCsproj",
212-
},
213-
"sourceMaps": true,
214-
"outFiles": [
215-
"${workspaceRoot}/dist/*.js",
216-
"${workspaceRoot}/out/omnisharptest/**/*.js"
69+
"resolveSourceMapLocations": [
70+
"${workspaceFolder}/**",
71+
"!**/node_modules/**"
21772
],
21873
"preLaunchTask": "buildDev"
21974
},
22075
{
221-
"name": "Omnisharp: Launch slnFilterWithCsproj Workspace Tests",
76+
"name": "Omnisharp: Launch Current File Integration Tests [LSP]",
22277
"type": "extensionHost",
22378
"request": "launch",
22479
"runtimeExecutable": "${execPath}",
22580
"args": [
22681
// Create a temp profile that has no extensions / user settings.
22782
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
22883
"--profile-temp",
229-
"${workspaceRoot}/test/integrationTests/testAssets/slnFilterWithCsproj",
84+
"${workspaceRoot}/omnisharptest/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_lsp_${input:omnisharpAssetName}.code-workspace",
23085
"--extensionDevelopmentPath=${workspaceRoot}",
23186
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
23287
],
23388
"env": {
23489
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
235-
"OSVC_SUITE": "slnFilterWithCsproj",
90+
"OSVC_SUITE": "${input:omnisharpAssetName}",
91+
"TEST_FILE_FILTER": "${file}",
23692
},
23793
"sourceMaps": true,
23894
"outFiles": [
23995
"${workspaceRoot}/dist/*.js",
240-
"${workspaceRoot}/out/omnisharptest/**/*.js"
241-
],
242-
"preLaunchTask": "buildDev"
243-
},
244-
{
245-
"name": "Omnisharp: Launch slnWithGenerator Workspace Tests",
246-
"type": "extensionHost",
247-
"request": "launch",
248-
"runtimeExecutable": "${execPath}",
249-
"args": [
250-
// Create a temp profile that has no extensions / user settings.
251-
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
252-
"--profile-temp",
253-
"${workspaceRoot}/test/integrationTests/testAssets/slnWithGenerator",
254-
"--extensionDevelopmentPath=${workspaceRoot}",
255-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
96+
"${workspaceRoot}/out/test/**/*.js"
25697
],
257-
"env": {
258-
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
259-
"OSVC_SUITE": "slnWithGenerator",
260-
},
261-
"sourceMaps": true,
262-
"outFiles": [
263-
"${workspaceRoot}/dist/*.js",
264-
"${workspaceRoot}/out/omnisharptest/**/*.js"
98+
"resolveSourceMapLocations": [
99+
"${workspaceFolder}/**",
100+
"!**/node_modules/**"
265101
],
266102
"preLaunchTask": "buildDev"
267103
},
@@ -312,28 +148,43 @@
312148
"NEW_DEPS_ID": "RazorTelemetry"
313149
},
314150
"cwd": "${workspaceFolder}"
315-
},
316-
{
317-
"type": "node",
318-
"request": "launch",
319-
"name": "Generate debugger options schema",
320-
"preLaunchTask": "build",
321-
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
322-
"args": [
323-
"generateOptionsSchema"
324-
],
325-
"cwd": "${workspaceFolder}"
326-
},
327-
{
328-
"type": "node",
329-
"request": "launch",
330-
"name": "Razor integration tests",
331-
"preLaunchTask": "build",
332-
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
333-
"args": [
334-
"test:razorintegration"
335-
],
336-
"cwd": "${workspaceFolder}"
337-
}
151+
},
152+
{
153+
"type": "node",
154+
"request": "launch",
155+
"name": "Generate debugger options schema",
156+
"preLaunchTask": "build",
157+
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
158+
"args": [
159+
"generateOptionsSchema"
160+
],
161+
"cwd": "${workspaceFolder}"
162+
},
163+
{
164+
"type": "node",
165+
"request": "launch",
166+
"name": "Razor integration tests",
167+
"preLaunchTask": "build",
168+
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
169+
"args": [
170+
"test:razorintegration"
171+
],
172+
"cwd": "${workspaceFolder}"
173+
}
174+
],
175+
"inputs": [
176+
{
177+
"id": "omnisharpAssetName",
178+
"description": "The name of the asset folder to use for the OmniSharp integration test.",
179+
"type": "pickString",
180+
"options": [
181+
"singleCsproj",
182+
"BasicRazorApp2_1",
183+
"slnWithCsproj",
184+
"slnFilterWithCsproj",
185+
"slnWithGenerator"
186+
]
187+
// type specific configuration attributes
188+
}
338189
]
339190
}

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
},
1717
"csharp.suppressDotnetRestoreNotification": true,
1818
"typescript.tsdk": "./node_modules/typescript/lib",
19-
"mocha.enabled": true,
2019
"omnisharp.autoStart": false,
2120
"editor.formatOnSave": false,
2221
"eslint.lintTask.enable": true,

.vscodeignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ CODEOWNERS
3535
gulpfile.ts
3636
!install.Lock
3737
ISSUE_TEMPLATE
38-
.mocharc.jsonc
3938
!README.md
4039
!CHANGELOG.md
4140
*.md

azure-pipelines/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ stages:
3131
targetPath: '$(Build.SourcesDirectory)/vsix'
3232
artifactName: 'VSIX_Prerelease_$(System.JobAttempt)'
3333

34-
- script: npm run omnisharptest:artifacts
34+
- script: npm run test:artifacts
3535
displayName: 'Run artifacts tests'
3636

3737
- job:
@@ -58,6 +58,6 @@ stages:
5858
targetPath: '$(Build.SourcesDirectory)/vsix'
5959
artifactName: 'VSIX_Release_$(System.JobAttempt)'
6060

61-
- script: npm run omnisharptest:artifacts
61+
- script: npm run test:artifacts
6262
displayName: 'Run artifacts tests'
6363

jest.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const config: Config = {
1010
'<rootDir>/test/integrationTests/jest.config.ts',
1111
'<rootDir>/test/razorIntegrationTests/jest.config.ts',
1212
'<rootDir>/test/razorTests/jest.config.ts',
13+
'<rootDir>/test/artifactTests/jest.config.ts',
1314
'<rootDir>/omnisharptest/omnisharpUnitTests/jest.config.ts',
15+
'<rootDir>/omnisharptest/omnisharpIntegrationTests/jest.config.ts',
1416
],
1517
};
1618

omnisharptest/omnisharpFeatureTests/index.ts

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

0 commit comments

Comments
 (0)