|
| 1 | +parameters: |
| 2 | + # Basic parameters mirroring style of other job templates |
| 3 | + pool: {} |
| 4 | + categoryName: dnupTests |
| 5 | + dependsOn: '' |
| 6 | + variables: {} |
| 7 | + oneESCompat: |
| 8 | + templateFolderName: templates |
| 9 | + publishTaskPrefix: '' |
| 10 | + timeoutInMinutes: 60 |
| 11 | + os: windows |
| 12 | + |
| 13 | +jobs: |
| 14 | +- job: ${{ parameters.categoryName }}_${{ parameters.os }} |
| 15 | + displayName: 'dnup tests: ${{ parameters.os }}' |
| 16 | + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} |
| 17 | + pool: ${{ parameters.pool }} |
| 18 | + dependsOn: ${{ parameters.dependsOn }} |
| 19 | + variables: |
| 20 | + - ${{ insert }}: ${{ parameters.variables }} |
| 21 | + steps: |
| 22 | + - ${{ if eq(parameters.os, 'windows') }}: |
| 23 | + - powershell: | |
| 24 | + Write-Host "Restoring dnup tests" |
| 25 | + dotnet restore test/dnup.Tests/dnup.Tests.csproj |
| 26 | + displayName: Restore |
| 27 | + - powershell: | |
| 28 | + dotnet build test/dnup.Tests/dnup.Tests.csproj -c Release --no-restore |
| 29 | + displayName: Build |
| 30 | + - powershell: | |
| 31 | + dotnet test test/dnup.Tests/dnup.Tests.csproj -c Release --no-build --logger "trx;LogFileName=dnup-tests.trx" --results-directory $(Build.SourcesDirectory)/artifacts/dnupTestResults |
| 32 | + displayName: Test |
| 33 | + - ${{ if ne(parameters.os, 'windows') }}: |
| 34 | + - script: | |
| 35 | + echo "Restoring dnup tests" |
| 36 | + dotnet restore test/dnup.Tests/dnup.Tests.csproj |
| 37 | + displayName: Restore |
| 38 | + - script: | |
| 39 | + dotnet build test/dnup.Tests/dnup.Tests.csproj -c Release --no-restore |
| 40 | + displayName: Build |
| 41 | + - script: | |
| 42 | + dotnet test test/dnup.Tests/dnup.Tests.csproj -c Release --no-build --logger "trx;LogFileName=dnup-tests.trx" --results-directory $(Build.SourcesDirectory)/artifacts/dnupTestResults |
| 43 | + displayName: Test |
| 44 | + - task: PublishTestResults@2 |
| 45 | + displayName: Publish dnup test results |
| 46 | + condition: always() |
| 47 | + inputs: |
| 48 | + testResultsFormat: VSTest |
| 49 | + testResultsFiles: '**/dnup-tests.trx' |
| 50 | + searchFolder: $(Build.SourcesDirectory)/artifacts/dnupTestResults |
| 51 | + testRunTitle: 'dnup ${{ parameters.os }}' |
| 52 | + - task: PublishBuildArtifacts@1 |
| 53 | + displayName: Publish dnup test artifacts |
| 54 | + condition: always() |
| 55 | + inputs: |
| 56 | + PathtoPublish: $(Build.SourcesDirectory)/artifacts/dnupTestResults |
| 57 | + ArtifactName: dnupTestResults_${{ parameters.os }} |
| 58 | + publishLocation: Container |
0 commit comments