diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 6439f9210a4..b20a77fcc8d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -77,11 +77,11 @@ "group": "build" }, { - "label": "Run tests (all)", + "label": "Run tests (all but integration)", "command": "./build.sh", "type": "shell", "args": [ - "-testAll" + "-testAllButIntegration" ], "windows": { "command": "${workspaceFolder}/Build.cmd", diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 39acc63cf23..bf87db92322 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -108,6 +108,7 @@ You can find all test options as separate flags. For example `build -testAll`: ```shell -testAll Run all tests + -testAllButIntegration Run all but integration tests -testCambridge Run Cambridge tests -testCompiler Run FSharpCompiler unit tests -testCompilerService Run FSharpCompilerService unit tests diff --git a/TESTGUIDE.md b/TESTGUIDE.md index 93972f7e144..77093336065 100644 --- a/TESTGUIDE.md +++ b/TESTGUIDE.md @@ -41,6 +41,7 @@ build -testAll -c Release | testScripting | Windows | Runs scripting fsx and fsi commandline tests | | test | Windows | Same as testDesktop | | testAll | Windows | Runs all above tests | +| testAllButIntegration | Windows | Runs all minus integration tests | Some test groups can only be run in `CI` configuration, for that, you need to pass the `-ci -bl` or `-ci -nobl` arguments. Some test groups can only be run in Release mode, this is indicated below. Some tests can only be run on Windows. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ca18d32ab22..df8e2173833 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -124,7 +124,7 @@ stages: - script: eng\CIBuild.cmd -configuration $(_BuildConfig) -prepareMachine - -testAll + -testAllButIntegration -officialSkipTests $(SkipTests) /p:SignType=$(_SignType) /p:DotNetSignType=$(_SignType) @@ -346,11 +346,18 @@ stages: vs_release: _configuration: Release _testKind: testVs - + ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + inttests_release: + _configuration: Release + _testKind: testIntegration steps: - checkout: self clean: true + - powershell: eng\SetupVSHive.ps1 + displayName: Setup VS Hive + condition: or(eq(variables['_testKind'], 'testVs'), eq(variables['_testKind'], 'testIntegration')) + - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) displayName: Build / Test - task: PublishTestResults@2 diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 075d8cdf5ed..be7ae7de99c 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -59,6 +59,7 @@ param ( [switch]$testScripting, [switch]$testVs, [switch]$testAll, + [switch]$testAllButIntegration, [switch]$testpack, [string]$officialSkipTests = "false", [switch]$noVisualStudio, @@ -95,6 +96,7 @@ function Print-Usage() { Write-Host "" Write-Host "Test actions" Write-Host " -testAll Run all tests" + Write-Host " -testAllButIntegration Run all but integration tests" Write-Host " -testCambridge Run Cambridge tests" Write-Host " -testCompiler Run FSharpCompiler unit tests" Write-Host " -testCompilerService Run FSharpCompilerService unit tests" @@ -148,8 +150,17 @@ function Process-Arguments() { $script:testVs = $True } + if ($testAllButIntegration) { + $script:testDesktop = $True + $script:testCoreClr = $True + $script:testFSharpQA = $True + $script:testIntegration = $False + $script:testVs = $True + } + if ([System.Boolean]::Parse($script:officialSkipTests)) { $script:testAll = $False + $script:testAllButIntegration = $False $script:testCambridge = $False $script:testCompiler = $False $script:testCompilerService = $False @@ -620,6 +631,10 @@ try { TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\VisualFSharp.UnitTests\" TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" } + + if ($testIntegration) { + TestUsingXUnit -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.IntegrationTests\" + } # verify nupkgs have access to the source code $nupkgtestFailed = $false