Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,31 @@ stages:
variables:
ROSLYN_SKIP_TEST_FILE_BASED_PROGRAMS: 'true'
jobs:
- template: azure-pipelines/test-matrix.yml
parameters:
os: macos
installDotNet: true
testVSCodeVersion: $(testVSCodeVersion)
pool:
name: Azure Pipelines
vmImage: macOS-15
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: azure-pipelines/test-matrix.yml
parameters:
os: macos
installDotNet: true
testVSCodeVersion: $(testVSCodeVersion)
pool:
name: Azure Pipelines
vmImage: macOS-15
matrix:
CSharpAndDevKitSanityTests:
npmCommand: test:integration:macos-pr
isIntegration: true
RazorCohostTests:
npmCommand: test:integration:razor:cohost
isIntegration: true
- ${{ else }}:
- template: azure-pipelines/test-matrix.yml
parameters:
os: macos
installDotNet: true
testVSCodeVersion: $(testVSCodeVersion)
pool:
name: Azure Pipelines
vmImage: macOS-15

- stage: Test_OmniSharp
displayName: Test OmniSharp
Expand Down
13 changes: 8 additions & 5 deletions azure-pipelines/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ parameters:
default: false
- name: testVSCodeVersion
type: string

jobs:
- job:
strategy:
matrix:
- name: matrix
type: object
default:
UnitTests:
npmCommand: test:unit
isIntegration: false
Expand All @@ -33,6 +31,11 @@ jobs:
UntrustedWorkspaceTest:
npmCommand: test:integration:untrusted
isIntegration: true

jobs:
- job:
strategy:
matrix: ${{ parameters.matrix }}
pool: ${{ parameters.pool }}
${{ if parameters.containerName }}:
container: ${{ parameters.containerName }}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"test:integration": "npm run test:integration:csharp && npm run test:integration:devkit && npm run test:integration:razor:cohost && npm run test:integration:untrusted",
"test:integration:csharp": "npm run packageDev && npx ts-node tasks/tests/testIntegrationCsharp.ts",
"test:integration:devkit": "npm run packageDev && npx ts-node tasks/tests/testIntegrationDevkit.ts",
"test:integration:macos-pr": "npm run packageDev && npx ts-node tasks/tests/testIntegrationMacOspr.ts",
"test:integration:razor:cohost": "npm run packageDev && npx ts-node tasks/tests/testIntegrationRazorCohost.ts",
"test:integration:untrusted": "npm run packageDev && npx ts-node tasks/tests/testIntegrationUntrusted.ts",
"test:unit": "npm run compileDev && npx ts-node tasks/tests/testUnit.ts",
Expand Down
9 changes: 9 additions & 0 deletions tasks/tests/testIntegrationMacOspr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { testIntegrationMacOSPR } from './testTasks';
import { runTask } from '../runTask';

runTask(testIntegrationMacOSPR);
Comment on lines +6 to +9
32 changes: 31 additions & 1 deletion tasks/tests/testTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
*--------------------------------------------------------------------------------------------*/

import path from 'path';
import { integrationTestProjects, runDevKitIntegrationTests, runIntegrationTest, runJestTest } from './testHelpers';
import {
basicSlnTestProject,
integrationTestProjects,
runDevKitIntegrationTests,
runIntegrationTest,
runJestTest,
} from './testHelpers';
import { jestArtifactTestsProjectName } from '../../test/lsptoolshost/artifactTests/jest.config';
import { jestUnitTestProjectName } from '../../test/lsptoolshost/unitTests/jest.config';
import { razorTestProjectName } from '../../test/razor/razorTests/jest.config';
import { jestTasksTestProjectName } from '../../test/tasks/jest.config';
import { rootPath } from '../projectPaths';

const razorIntegrationTestProjects = ['RazorApp'];

Expand All @@ -32,6 +39,29 @@ export async function testIntegrationDevkit(): Promise<void> {
}
}

// Full macOS integration runs are frequently the PR long pole. Exercise extension activation, project loading,
// and completion through both C# and Dev Kit here. Full feature coverage is handled by both non-macOS legs
// and in non-PR builds for macOS.
export async function testIntegrationMacOSPR(): Promise<void> {
const testFolderName = path.join('lsptoolshost', 'integrationTests');
const completionTestFile = path.join(rootPath, 'test', testFolderName, 'completion.integration.test.ts');

await runIntegrationTest(
basicSlnTestProject,
testFolderName,
'CSharp-macOS-PR',
`${basicSlnTestProject}.code-workspace`,
completionTestFile
);
await runIntegrationTest(
basicSlnTestProject,
testFolderName,
'DevKit-macOS-PR',
`devkit_${basicSlnTestProject}.code-workspace`,
completionTestFile
);
}

export async function testIntegrationRazorCohost(): Promise<void> {
for (const projectName of razorIntegrationTestProjects) {
await runIntegrationTest(projectName, path.join('razor', 'razorIntegrationTests'), `Razor-${projectName}`);
Expand Down