diff --git a/build/deploy-test-resources.yml b/build/deploy-test-resources.yml index 96e6d505..6bb5ffa9 100644 --- a/build/deploy-test-resources.yml +++ b/build/deploy-test-resources.yml @@ -68,4 +68,10 @@ stages: inlineScript: | Install-Module -Name Az -Force -AllowClobber -SkipPublisherCheck Install-Module -Name Pester -Force -SkipPublisherCheck - Invoke-Pester -Script "./build/templates/smoke-tests.ps1" -OutputFile "./pester.test.results.xml" -OutputFormat 'NUnitXML' -EnableExit \ No newline at end of file + Invoke-Pester -Script "./build/templates/smoke-tests.ps1" -OutputFile "./pester.test.results.xml" -OutputFormat 'NUnitXML' -EnableExit + - task: PublishTestResults@2 + displayName: 'Publish test results' + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: '**/pester.test.results.xml' + failTaskOnFailedTests: true \ No newline at end of file diff --git a/build/templates/smoke-tests.ps1 b/build/templates/smoke-tests.ps1 index 40b96593..000c6443 100644 --- a/build/templates/smoke-tests.ps1 +++ b/build/templates/smoke-tests.ps1 @@ -6,14 +6,14 @@ BeforeAll { Describe 'Storage account' { It 'Service principal can get blob container' { - Get-AzStorageContainer -ResourceGroupName $env:resourceGroupName + Get-AzStorageContainer } It 'Service principal can create blob container' { $containerName = 'test-container' try { - New-AzStorageContainer -ResourceGroupName $env:resourceGroupName -Name $containerName + New-AzStorageContainer -Name $containerName } finally { - Remove-AzStorageContainer -ResourceGroupName $env:resourceGroupName -Name $containerName -Force + Remove-AzStorageContainer -Name $containerName -Force } } } \ No newline at end of file