mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 15:20:11 +00:00
* first part * fix session manager plugin * rework AWS installation * azure cosmos db tests * azure devops cli * add azmodules test * put brackets * add root folder * remove validate aliyun * add azure modules * update modules test * docker, baze, dotnetsdk * DACFx * add azdevopscli * change to Should -BeTrue * nitpicks * remove extra * add azurecli * remove BeforeAll for DACFx * a bit of refactoring * fix templates * remove disk space validation * rename to powershell modules * fix templates
This commit is contained in:
26
images/win/scripts/Tests/DotnetSDK.Tests.ps1
Normal file
26
images/win/scripts/Tests/DotnetSDK.Tests.ps1
Normal file
@@ -0,0 +1,26 @@
|
||||
$releaseIndexUrl = "https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json"
|
||||
$dotnetChannels = (New-Object system.net.webclient).DownloadString($releaseIndexUrl) | ConvertFrom-Json
|
||||
$dotnetVersions = $dotnetChannels.'releases-index' | Where-Object { (!$_."support-phase".Equals('preview') -and !$_."support-phase".Equals('eol')) } | Select-Object -ExpandProperty "channel-version"
|
||||
|
||||
Describe "Dotnet SDK" {
|
||||
|
||||
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 {
|
||||
(dotnet --list-sdks | Where-Object { $_ -match "${dotnetVersion}\.[0-9]*" }).Count | Should -BeGreaterThan 0
|
||||
}
|
||||
|
||||
It "Runtime $version is available" -TestCases $dotnet {
|
||||
(dotnet --list-runtimes | Where-Object { $_ -match "${dotnetVersion}\.[0-9]*" }).Count | Should -BeGreaterThan 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user