mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-16 06:46:48 +00:00
[ubuntu] Refactor pester tests (#9006)
* [ubuntu] Refactor pester tests * Fix key name and add BeforeAll * Fix ActionArchiveCache test
This commit is contained in:
committed by
GitHub
parent
2179765026
commit
dbb10c67ba
@@ -1,13 +1,12 @@
|
||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||
|
||||
Describe "Dotnet and tools" {
|
||||
|
||||
BeforeAll {
|
||||
$env:PATH = "/etc/skel/.dotnet/tools:$($env:PATH)"
|
||||
$dotnetSDKs = dotnet --list-sdks | ConvertTo-Json
|
||||
$dotnetRuntimes = dotnet --list-runtimes | ConvertTo-Json
|
||||
}
|
||||
|
||||
|
||||
$dotnetVersions = (Get-ToolsetContent).dotnet.versions
|
||||
|
||||
Context "Default" {
|
||||
@@ -20,11 +19,11 @@ Describe "Dotnet and tools" {
|
||||
Context "Dotnet $version" {
|
||||
$dotnet = @{ dotnetVersion = $version }
|
||||
|
||||
It "SDK $version is available" -TestCases $dotnet {
|
||||
It "SDK <dotnetVersion> is available" -TestCases $dotnet {
|
||||
$dotnetSDKs | Should -Match "$dotnetVersion.[1-9]*"
|
||||
}
|
||||
|
||||
It "Runtime $version is available" -TestCases $dotnet {
|
||||
It "Runtime <dotnetVersion> is available" -TestCases $dotnet {
|
||||
$dotnetRuntimes | Should -Match "$dotnetVersion.[1-9]*"
|
||||
}
|
||||
}
|
||||
@@ -38,5 +37,4 @@ Describe "Dotnet and tools" {
|
||||
"$TestInstance" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user