diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 92a8020846..30e69c2e36 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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 diff --git a/azure-pipelines/test-matrix.yml b/azure-pipelines/test-matrix.yml index a8743e0b55..a1996cebe0 100644 --- a/azure-pipelines/test-matrix.yml +++ b/azure-pipelines/test-matrix.yml @@ -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 @@ -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 }} diff --git a/package.json b/package.json index 259332cf1f..9f6c3ae1ef 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/tasks/tests/testIntegrationMacOspr.ts b/tasks/tests/testIntegrationMacOspr.ts new file mode 100644 index 0000000000..2ba0a4142b --- /dev/null +++ b/tasks/tests/testIntegrationMacOspr.ts @@ -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); diff --git a/tasks/tests/testTasks.ts b/tasks/tests/testTasks.ts index 8bf8dd0f23..e88e9e3a44 100644 --- a/tasks/tests/testTasks.ts +++ b/tasks/tests/testTasks.ts @@ -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']; @@ -32,6 +39,29 @@ export async function testIntegrationDevkit(): Promise { } } +// 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 { + 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 { for (const projectName of razorIntegrationTestProjects) { await runIntegrationTest(projectName, path.join('razor', 'razorIntegrationTests'), `Razor-${projectName}`);