Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (51 sloc) 1.77 KB
parameters:
dotnetSdkVersion: ''
projectName: 'src/*.sln'
category: ''
steps:
- bash: |
if [ -z "$DOTNET_SDK_VERSION" ]; then
echo "##vso[task.logissue type=error;]Missing template parameter \"dotnetSdkVersion\""
echo "##vso[task.complete result=Failed;]"
fi
if [ -z "$PROJECTS" ]; then
echo "##vso[task.logissue type=error;]Missing template parameter \"projectName\""
echo "##vso[task.complete result=Failed;]"
fi
env:
DOTNET_SDK_VERSION: ${{ parameters.dotnetSdkVersion }}
PROJECTS: ${{ parameters.projectName }}
displayName: Check for required parameters in YAML template
- powershell: |
$categoryCommand = '';
if ('${{ parameters.category }}' -ne '') {
$categoryCommand = '--filter Category=${{ parameters.category }}';
Write-Host "Category command = $categoryCommand"
}
Write-Host "##vso[task.setvariable variable=categoryCommand]$categoryCommand"
displayName: 'Determine filter category command'
- task: UseDotNet@2
displayName: 'Import .NET Core SDK (${{ parameters.dotnetSdkVersion }})'
inputs:
packageType: 'sdk'
version: '${{ parameters.dotnetSdkVersion }}'
- task: qetza.replacetokens.replacetokens-task.replacetokens@3
displayName: 'Replace integration test tokens'
inputs:
rootDirectory: 'src/${{ parameters.projectName }}/'
targetFiles: 'appsettings.json'
encoding: 'auto'
verbosity: 'detailed'
writeBOM: true
actionOnMissing: 'fail'
keepToken: false
tokenPrefix: '#{'
tokenSuffix: '}#'
- task: DotNetCoreCLI@2
displayName: 'Run integration tests'
inputs:
command: test
projects: 'src/**/${{ parameters.projectName }}.csproj'
arguments: '--configuration $(Build.Configuration) $(categoryCommand)'
nobuild: true
publishTestResults: true
You can’t perform that action at this time.