AL-Go/Tests/CreateApp.Action.Test.ps1

33 строки
1.3 KiB
PowerShell
Исходник Обычный вид История

2021-10-21 08:38:16 +03:00
Get-Module TestActionsHelper | Remove-Module -Force
Import-Module (Join-Path $PSScriptRoot 'TestActionsHelper.psm1')
PowerPlatform integration (#927) Fixes #361 New Settings: - PowerPlatformSolutionFolder - containing the name of the folder containing a PowerPlatform Solution (only one) - companyId and ppEnvironmentUrl added to deploymentSettings for environments. New Actions: - BuildPowerPlatform - to build a PowerPlatform Solution - DeployPowerPlatform - to deploy a PowerPlatform Solution - PullPowerPlatformChanges - to pull changes made in PowerPlatform studio into the repository - ReadPowerPlatformSettings - to read settings and secrets for PowerPlatform deployment - GetArtifactsForDeployment - originally code from deploy.ps1 to retrieve artifacts for releases or builds - now as an action to read apps into a folder. New Workflows: - Pull PowerPlatform Changes - Push PowerPlatform Changes Other changes - Getting artifacts for deployment moved from deploy.ps1 to a seperate action - Test for specific version of containerhelper moved to avoid many warnings - Add scenarios for PowerPlatform - Add PowerPlatformSolution artifact to builds - Add unpack parameter to DownloadArtifact to unpack after download. TO:DO - [x] Fix failing CI tests - [x] Ensure End 2 End test are passing - [x] Increment version number in PowerPlatform project (awaits Increment Version Number PR from @mazhelez) - [x] Unit Tests - [x] End 2 End test - [x] Remove PREVIEW prefix from various docs - [x] Remove usage of private version of BcContainerHelper - [x] Release notes - [x] Document new settings --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com> Co-authored-by: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com> Co-authored-by: Alexander Holstrup <117829001+aholstrup1@users.noreply.github.com> Co-authored-by: andersgMSFT <90765077+andersgMSFT@users.noreply.github.com>
2024-05-14 10:27:47 +03:00
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0
2021-10-21 08:38:16 +03:00
2021-10-21 09:10:07 +03:00
Describe "CreateApp Action Tests" {
2021-10-22 00:31:19 +03:00
BeforeAll {
$actionName = "CreateApp"
$scriptRoot = Join-Path $PSScriptRoot "..\Actions\$actionName" -Resolve
2021-11-01 12:18:28 +03:00
$scriptName = "$actionName.ps1"
2023-09-05 11:40:42 +03:00
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'scriptPath', Justification = 'False positive.')]
2021-11-01 12:18:28 +03:00
$scriptPath = Join-Path $scriptRoot $scriptName
2023-09-05 11:40:42 +03:00
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'actionScript', Justification = 'False positive.')]
2021-11-01 12:18:28 +03:00
$actionScript = GetActionScript -scriptRoot $scriptRoot -scriptName $scriptName
2021-10-22 00:31:19 +03:00
}
2021-10-21 08:38:16 +03:00
It 'Compile Action' {
2021-10-21 09:03:36 +03:00
Invoke-Expression $actionScript
2021-10-21 08:38:16 +03:00
}
2021-10-20 22:57:40 +03:00
It 'Test action.yaml matches script' {
$permissions = [ordered]@{
"contents" = "write"
"pull-requests" = "write"
}
2021-10-21 08:53:21 +03:00
$outputs = [ordered]@{
2021-10-21 08:38:16 +03:00
}
2021-10-21 09:03:36 +03:00
YamlTest -scriptRoot $scriptRoot -actionName $actionName -actionScript $actionScript -permissions $permissions -outputs $outputs
2021-10-20 22:57:40 +03:00
}
2021-10-21 08:38:16 +03:00
# Call action
2021-10-20 22:57:40 +03:00
}