Skip to content

Commit 5a35b2e

Browse files
committed
Move OmniSharp test code under the /test folder
1 parent 222fe7d commit 5a35b2e

File tree

332 files changed

+625
-275
lines changed

Some content is hidden

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

332 files changed

+625
-275
lines changed

.config/guardian/.gdnbaselines

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"d6ffb0614846153cf3cc5936d0444ed9eda6fe6854febb4c8ea59243c120b223": {
1515
"signature": "d6ffb0614846153cf3cc5936d0444ed9eda6fe6854febb4c8ea59243c120b223",
1616
"alternativeSignatures": [],
17-
"target": "omnisharptest/omnisharpUnitTests/testAssets/private.pem",
17+
"target": "test/omnisharp/omnisharpUnitTests/testAssets/private.pem",
1818
"line": 1,
1919
"memberOf": [
2020
"default"
@@ -26,4 +26,4 @@
2626
"justification": "This error is baselined with an expiration date of 180 days from 2024-06-27 21:44:58Z"
2727
}
2828
}
29-
}
29+
}

.vscode/launch.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
// Create a temp profile that has no extensions / user settings.
2121
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
2222
"--profile-temp",
23-
"${workspaceRoot}/test/integrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace",
23+
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/lsp_tools_host_slnWithCsproj.code-workspace",
2424
"--extensionDevelopmentPath=${workspaceRoot}",
25-
"--extensionTestsPath=${workspaceRoot}/out/test/integrationTests"
25+
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
2626
],
2727
"env": {
2828
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
@@ -43,9 +43,9 @@
4343
// Create a temp profile that has no extensions / user settings.
4444
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
4545
"--profile-temp",
46-
"${workspaceRoot}/test/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/lsp_tools_host_BasicRazorApp2_1.code-workspace",
46+
"${workspaceRoot}/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/lsp_tools_host_BasicRazorApp2_1.code-workspace",
4747
"--extensionDevelopmentPath=${workspaceRoot}",
48-
"--extensionTestsPath=${workspaceRoot}/out/test/razorIntegrationTests"
48+
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests"
4949
],
5050
"env": {
5151
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
@@ -66,9 +66,9 @@
6666
// Create a temp profile that has no extensions / user settings.
6767
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
6868
"--profile-temp",
69-
"${workspaceRoot}/omnisharptest/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_${input:omnisharpAssetName}.code-workspace",
69+
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_${input:omnisharpAssetName}.code-workspace",
7070
"--extensionDevelopmentPath=${workspaceRoot}",
71-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
71+
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"
7272
],
7373
"env": {
7474
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
@@ -89,9 +89,9 @@
8989
// Create a temp profile that has no extensions / user settings.
9090
// This allows us to only have the C# extension + the dotnet runtime installer extension dependency.
9191
"--profile-temp",
92-
"${workspaceRoot}/omnisharptest/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_lsp_${input:omnisharpAssetName}.code-workspace",
92+
"${workspaceRoot}/test/omnisharp/omnisharpIntegrationTests/testAssets/${input:omnisharpAssetName}/.vscode/omnisharp_lsp_${input:omnisharpAssetName}.code-workspace",
9393
"--extensionDevelopmentPath=${workspaceRoot}",
94-
"--extensionTestsPath=${workspaceRoot}/out/omnisharptest/omnisharpIntegrationTests"
94+
"--extensionTestsPath=${workspaceRoot}/out/test/omnisharp/omnisharpIntegrationTests"
9595
],
9696
"env": {
9797
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",

.vscodeignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ server/**
1818
src/**
1919
tasks/**
2020
test/**
21-
omnisharptest/**
2221
__mocks__/**
2322
jest.config.ts
2423
baseJestConfig.ts

__mocks__/vscode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as vscodeAdapter from '../src/vscodeAdapter';
7-
import { getFakeVsCode } from '../test/unitTests/fakes';
7+
import { getFakeVsCode } from '../test/fakes';
88

99
// This module creates a manual mock for the vscode module for running in unit tests.
1010
// Jest will automatically pick this up as it is in the __mocks__ directory next to node_modules.

jest.config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import type { Config } from 'jest';
66

77
const config: Config = {
88
projects: [
9-
'<rootDir>/test/unitTests/jest.config.ts',
10-
'<rootDir>/test/integrationTests/jest.config.ts',
11-
'<rootDir>/test/razorIntegrationTests/jest.config.ts',
12-
'<rootDir>/test/razorTests/jest.config.ts',
13-
'<rootDir>/test/artifactTests/jest.config.ts',
14-
'<rootDir>/omnisharptest/omnisharpUnitTests/jest.config.ts',
15-
'<rootDir>/omnisharptest/omnisharpIntegrationTests/jest.config.ts',
9+
'<rootDir>/test/lsptoolshost/artifactTests/jest.config.ts',
10+
'<rootDir>/test/lsptoolshost/integrationTests/jest.config.ts',
11+
'<rootDir>/test/lsptoolshost/unitTests/jest.config.ts',
12+
'<rootDir>/test/omnisharp/omnisharpIntegrationTests/jest.config.ts',
13+
'<rootDir>/test/omnisharp/omnisharpUnitTests/jest.config.ts',
14+
'<rootDir>/test/razor/razorIntegrationTests/jest.config.ts',
15+
'<rootDir>/test/razor/razorTests/jest.config.ts',
1616
],
1717
// Reporters are a global jest configuration property and cannot be set in the project jest config.
1818
// This configuration will create a 'junit.xml' file in the output directory, no matter which test project is running.

tasks/testTasks.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import { codeExtensionPath, rootPath, outPath } from './projectPaths';
1010
import spawnNode from './spawnNode';
1111
import * as jest from 'jest';
1212
import { Config } from '@jest/types';
13-
import { jestOmniSharpUnitTestProjectName } from '../omnisharptest/omnisharpUnitTests/jest.config';
14-
import { jestUnitTestProjectName } from '../test/unitTests/jest.config';
15-
import { razorTestProjectName } from '../test/razorTests/jest.config';
16-
import { jestArtifactTestsProjectName } from '../test/artifactTests/jest.config';
13+
import { jestOmniSharpUnitTestProjectName } from '../test/omnisharp/omnisharpUnitTests/jest.config';
14+
import { jestUnitTestProjectName } from '../test/lsptoolshost/unitTests/jest.config';
15+
import { razorTestProjectName } from '../test/razor/razorTests/jest.config';
16+
import { jestArtifactTestsProjectName } from '../test/lsptoolshost/artifactTests/jest.config';
1717

1818
gulp.task('test:razor', async () => {
1919
runJestTest(razorTestProjectName);
@@ -22,7 +22,11 @@ gulp.task('test:razor', async () => {
2222
const razorIntegrationTestProjects = ['BasicRazorApp2_1'];
2323
for (const projectName of razorIntegrationTestProjects) {
2424
gulp.task(`test:razorintegration:${projectName}`, async () =>
25-
runIntegrationTest(projectName, 'razorIntegrationTests', `Razor Test Integration ${projectName}`)
25+
runIntegrationTest(
26+
projectName,
27+
path.join('razor', 'razorIntegrationTests'),
28+
`Razor Test Integration ${projectName}`
29+
)
2630
);
2731
}
2832

@@ -76,7 +80,11 @@ gulp.task('test:unit', async () => {
7680
const integrationTestProjects = ['slnWithCsproj'];
7781
for (const projectName of integrationTestProjects) {
7882
gulp.task(`test:integration:${projectName}`, async () =>
79-
runIntegrationTest(projectName, 'integrationTests', `Test Integration ${projectName}`)
83+
runIntegrationTest(
84+
projectName,
85+
path.join('lsptoolshost', 'integrationTests'),
86+
`Test Integration ${projectName}`
87+
)
8088
);
8189
}
8290

@@ -89,7 +97,7 @@ gulp.task('test', gulp.series('test:unit', 'test:integration', 'test:razor', 'te
8997

9098
async function runOmnisharpJestIntegrationTest(testAssetName: string, engine: 'stdio' | 'lsp', suiteName: string) {
9199
const workspaceFile = `omnisharp${engine === 'lsp' ? '_lsp' : ''}_${testAssetName}.code-workspace`;
92-
const testFolder = path.join('omnisharptest', 'omnisharpIntegrationTests');
100+
const testFolder = path.join('test', 'omnisharp', 'omnisharpIntegrationTests');
93101

94102
const env = {
95103
OSVC_SUITE: testAssetName,

test/unitTests/fakes.ts renamed to test/fakes.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as vscode from '../../src/vscodeAdapter';
7-
import * as protocol from '../../src/omnisharp/protocol';
8-
import { ITelemetryReporter } from '../../src/shared/telemetryReporter';
9-
import { MSBuildDiagnosticsMessage } from '../../src/omnisharp/protocol';
6+
import * as vscode from '../src/vscodeAdapter';
7+
import * as protocol from '../src/omnisharp/protocol';
8+
import { ITelemetryReporter } from '../src/shared/telemetryReporter';
9+
import { MSBuildDiagnosticsMessage } from '../src/omnisharp/protocol';
1010
import {
1111
OmnisharpServerMsBuildProjectDiagnostics,
1212
OmnisharpServerOnError,
1313
OmnisharpServerUnresolvedDependencies,
1414
WorkspaceInformationUpdated,
15-
} from '../../src/omnisharp/loggingEvents';
16-
import * as vscodeAdapter from '../../src/vscodeAdapter';
15+
} from '../src/omnisharp/loggingEvents';
16+
import * as vscodeAdapter from '../src/vscodeAdapter';
1717

1818
export const getNullChannel = (): vscode.OutputChannel => {
1919
const returnChannel: vscode.OutputChannel = {

test/artifactTests/jest.config.ts renamed to test/lsptoolshost/artifactTests/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55
import type { Config } from 'jest';
6-
import { baseProjectConfig } from '../../baseJestConfig';
6+
import { baseProjectConfig } from '../../../baseJestConfig';
77

88
export const jestArtifactTestsProjectName = 'Artifact Tests';
99

test/integrationTests/buildDiagnostics.integration.test.ts renamed to test/lsptoolshost/integrationTests/buildDiagnostics.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import * as vscode from 'vscode';
77
import { describe, test, expect, beforeAll, afterAll, beforeEach, afterEach } from '@jest/globals';
88
import testAssetWorkspace from './testAssets/testAssetWorkspace';
9-
import { AnalysisSetting, BuildDiagnosticsService } from '../../src/lsptoolshost/buildDiagnosticsService';
9+
import { AnalysisSetting, BuildDiagnosticsService } from '../../../src/lsptoolshost/buildDiagnosticsService';
1010
import * as integrationHelpers from './integrationHelpers';
1111
import path = require('path');
1212
describe(`Build and live diagnostics dedupe ${testAssetWorkspace.description}`, () => {

0 commit comments

Comments
 (0)