Add an ADO yaml file for integration tests (#1035)

* enable code coverage for ADO test run

* fix debugtype default

* use file name instead of guid

* use wildcard for test dll name
This commit is contained in:
David Shiflet
2020-08-02 15:05:17 -04:00
committed by GitHub
parent 2d801770d1
commit 79e81a69b2
9 changed files with 91 additions and 29 deletions

View File

@@ -0,0 +1,52 @@
pool:
name: SqlToolsTestAgentPool
steps:
- task: DownloadSecureFile@1
displayName: 'Download secure file'
inputs:
secureFile: 'testsettings.json'
- task: VisualStudioTestPlatformInstaller@1
displayName: 'Visual Studio Test Platform Installer'
inputs:
versionSelector: latestStable
- task: UseDotNet@2
displayName: 'Use .NET Core sdk '
inputs:
useGlobalJson: true
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
projects: '**/Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj'
- task: CopyFiles@2
displayName: 'Copy testsettings file to bin'
inputs:
SourceFolder: '$(Agent.TempDirectory)'
Contents: '**\testsettings.json'
TargetFolder: '$(Build.SourcesDirectory)\test\Microsoft.SqlTools.ServiceLayer.IntegrationTests\bin\Debug\netcoreapp3.1'
- task: DotNetCoreCLI@2
displayName: 'Run integration tests'
inputs:
command: test
projects: '**/Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj'
arguments: '--no-build'
testRunTitle: 'SqlToolsService Integration Tests'
enabled: false
- task: VSTest@2
displayName: 'Run integration tests with code coverage'
inputs:
testAssemblyVer2: '**/bin/Debug/**/Microsoft.SqlTools.ServiceLayer.IntegrationTests.dll'
vsTestVersion: toolsInstaller
runSettingsFile: 'azure-pipelines/testrun.runsettings'
codeCoverageEnabled: true
testRunTitle: 'SqlToolsService Integration Tests'
rerunFailedTests: true
rerunFailedThreshold: 15
rerunMaxAttempts: 1
continueOnError: true