mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[Ubuntu] Implement new directories hierarchy (#8627)
This commit is contained in:
committed by
GitHub
parent
d1f2c9a3be
commit
5d40b1e213
42
images/ubuntu/scripts/tests/DotnetSDK.Tests.ps1
Normal file
42
images/ubuntu/scripts/tests/DotnetSDK.Tests.ps1
Normal file
@@ -0,0 +1,42 @@
|
||||
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" {
|
||||
It "Default Dotnet SDK is available" {
|
||||
"dotnet --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($version in $dotnetVersions) {
|
||||
Context "Dotnet $version" {
|
||||
$dotnet = @{ dotnetVersion = $version }
|
||||
|
||||
It "SDK $version is available" -TestCases $dotnet {
|
||||
$dotnetSDKs | Should -Match "$dotnetVersion.[1-9]*"
|
||||
}
|
||||
|
||||
It "Runtime $version is available" -TestCases $dotnet {
|
||||
$dotnetRuntimes | Should -Match "$dotnetVersion.[1-9]*"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Context "Dotnet tools" {
|
||||
$dotnetTools = (Get-ToolsetContent).dotnet.tools
|
||||
$testCases = $dotnetTools | ForEach-Object { @{ ToolName = $_.name; TestInstance = $_.test }}
|
||||
|
||||
It "<ToolName> is available" -TestCases $testCases {
|
||||
"$TestInstance" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user