forked from microsoft/AL-Go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReadSecrets.Action.Test.ps1
32 lines (27 loc) · 1.45 KB
/
ReadSecrets.Action.Test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Get-Module TestActionsHelper | Remove-Module -Force
Import-Module (Join-Path $PSScriptRoot 'TestActionsHelper.psm1')
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0
Describe "ReadSecrets Action Tests" {
BeforeAll {
$actionName = "ReadSecrets"
$scriptRoot = Join-Path $PSScriptRoot "..\Actions\$actionName" -Resolve
$scriptName = "$actionName.ps1"
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'scriptPath', Justification = 'False positive.')]
$scriptPath = Join-Path $scriptRoot $scriptName
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'actionScript', Justification = 'False positive.')]
$actionScript = GetActionScript -scriptRoot $scriptRoot -scriptName $scriptName
}
It 'Compile Action' {
Invoke-Expression $actionScript
}
It 'Test action.yaml matches script' {
$permissions = [ordered]@{
}
$outputs = [ordered]@{
"Secrets" = "All requested secrets in compressed JSON format"
"TokenForPush" = "The token to use when workflows are pushing changes (either directly, or via pull requests)."
}
YamlTest -scriptRoot $scriptRoot -actionName $actionName -actionScript $actionScript -permissions $permissions -outputs $outputs
}
# Call action
}