mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 08:22:12 +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,14 +1,17 @@
|
||||
Describe "ActionArchiveCache" {
|
||||
BeforeDiscovery {
|
||||
$actionArchiveCachePath = "/opt/actionarchivecache"
|
||||
$tarballTestCases = Get-ChildItem -Path "$actionArchiveCachePath/*.tar.gz" -Recurse | ForEach-Object { @{ ActionTarball = $_.FullName } }
|
||||
}
|
||||
|
||||
Context "Action archive cache directory not empty" {
|
||||
It "/opt/actionarchivecache not empty" {
|
||||
(Get-ChildItem -Path "/opt/actionarchivecache/*.tar.gz" -Recurse).Count | Should -BeGreaterThan 0
|
||||
It "<ActionArchiveCachepath> not empty" -TestCases @{ ActionArchiveCachepath = $actionArchiveCachePath } {
|
||||
(Get-ChildItem -Path "$ActionArchiveCachepath/*.tar.gz" -Recurse).Count | Should -BeGreaterThan 0
|
||||
}
|
||||
}
|
||||
|
||||
Context "Action tarball not empty" {
|
||||
$testCases = Get-ChildItem -Path "/opt/actionarchivecache/*.tar.gz" -Recurse | ForEach-Object { @{ ActionTarball = $_.FullName } }
|
||||
It "<ActionTarball>" -TestCases $testCases {
|
||||
param ([string] $ActionTarball)
|
||||
It "<ActionTarball>" -TestCases $tarballTestCases {
|
||||
(Get-Item "$ActionTarball").Length | Should -BeGreaterThan 0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user