mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +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,34 +1,4 @@
|
||||
Describe "Android" {
|
||||
BeforeAll {
|
||||
function Test-AndroidPackage {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This function tests existance of an Android package.
|
||||
|
||||
.DESCRIPTION
|
||||
The Test-AndroidPackage function is used to test an existance of Android package in ANDROID_HOME path.
|
||||
|
||||
.PARAMETER PackageName
|
||||
The name of the Android package to test.
|
||||
|
||||
.EXAMPLE
|
||||
Test-AndroidPackage
|
||||
|
||||
This command tests the Android package.
|
||||
|
||||
#>
|
||||
param (
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string] $PackageName
|
||||
)
|
||||
|
||||
# Convert 'cmake;3.6.4111459' -> 'cmake/3.6.4111459'
|
||||
$PackageName = $PackageName.Replace(";", "/")
|
||||
$targetPath = Join-Path $env:ANDROID_HOME $PackageName
|
||||
$targetPath | Should -Exist
|
||||
}
|
||||
}
|
||||
|
||||
function Get-AndroidPackages {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
@@ -130,8 +100,10 @@ Describe "Android" {
|
||||
$testCases = $androidPackages | ForEach-Object { @{ PackageName = $_ } }
|
||||
|
||||
It "<PackageName>" -TestCases $testCases {
|
||||
param ([string] $PackageName)
|
||||
Test-AndroidPackage $PackageName
|
||||
# Convert 'cmake;3.6.4111459' -> 'cmake/3.6.4111459'
|
||||
$PackageName = $PackageName.Replace(";", "/")
|
||||
$targetPath = Join-Path $env:ANDROID_HOME $PackageName
|
||||
$targetPath | Should -Exist
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user