AL-Go/Tests/VerifyPRChanges.Action.Test...

148 строки
7.3 KiB
PowerShell
Исходник Постоянная ссылка Обычный вид История

2023-09-05 11:40:42 +03:00
Get-Module TestActionsHelper | Remove-Module -Force
2023-02-13 15:32:16 +03:00
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
2023-02-13 15:32:16 +03:00
Describe 'VerifyPRChanges Action Tests' {
BeforeAll {
$actionName = "VerifyPRChanges"
$scriptRoot = Join-Path $PSScriptRoot "..\Actions\$actionName" -Resolve
$scriptName = "$actionName.ps1"
2023-09-05 11:40:42 +03:00
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'scriptPath', Justification = 'False positive.')]
2023-02-13 15:32:16 +03:00
$scriptPath = Join-Path $scriptRoot $scriptName
2023-09-05 11:40:42 +03:00
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'actionScript', Justification = 'False positive.')]
2023-02-13 15:32:16 +03:00
$actionScript = GetActionScript -scriptRoot $scriptRoot -scriptName $scriptName
}
It 'should fail if the PR is from a fork and changes a script' {
AppSource: Bug fixes, Publish dependencies and Documentation (#1027) ### Issues - ContainerName used during build was invalid if project names contained special characters - Issue 1009 by adding a includeDependencies property in DeliverToAppSource - Issue 997 'Deliver to AppSource' action fails for projects containing a space (or any special character) - Issue 987 Resource not accessible by integration when creating release from specific version - Issue 979 Publish to AppSource Documentation ### New Settings - `deliverToAppSource`: a JSON object containing the following properties - **productId** must be the product Id from partner Center. - **mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project. - **continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production. - **includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. Note that you need to set `generateDependencyArtifact` in the project settings file to true in order to include dependencies. ### Deprecated Settings - `appSourceContinuousDelivery` is moved to the `deliverToAppSource` structure - `appSourceMainAppFolder` is moved to the `deliverToAppSource` structure - `appSourceProductId` is moved to the `deliverToAppSource` structure Fixes #1009 Fixes #997 Fixes #987 Fixes #979 --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com>
2024-04-13 13:13:16 +03:00
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '{ "changed_files": 1 }' } } -ParameterFilter { $Uri -and $Uri -notmatch "/files"}
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '[{"filename": "Scripts/BuildScript.ps1", "status": "modified"}]' } } -ParameterFilter { $Uri -and $Uri -match "/files"}
2023-09-05 11:40:42 +03:00
{
2023-02-13 15:32:16 +03:00
& $scriptPath `
-prBaseRepository "microsoft/AL-Go" `
-pullRequestId "123456" `
2023-09-05 11:40:42 +03:00
-token "ABC"
2023-02-13 15:32:16 +03:00
} | Should -Throw
}
It 'should fail if the PR is from a fork and adds a script' {
AppSource: Bug fixes, Publish dependencies and Documentation (#1027) ### Issues - ContainerName used during build was invalid if project names contained special characters - Issue 1009 by adding a includeDependencies property in DeliverToAppSource - Issue 997 'Deliver to AppSource' action fails for projects containing a space (or any special character) - Issue 987 Resource not accessible by integration when creating release from specific version - Issue 979 Publish to AppSource Documentation ### New Settings - `deliverToAppSource`: a JSON object containing the following properties - **productId** must be the product Id from partner Center. - **mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project. - **continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production. - **includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. Note that you need to set `generateDependencyArtifact` in the project settings file to true in order to include dependencies. ### Deprecated Settings - `appSourceContinuousDelivery` is moved to the `deliverToAppSource` structure - `appSourceMainAppFolder` is moved to the `deliverToAppSource` structure - `appSourceProductId` is moved to the `deliverToAppSource` structure Fixes #1009 Fixes #997 Fixes #987 Fixes #979 --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com>
2024-04-13 13:13:16 +03:00
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '{ "changed_files": 1 }' } } -ParameterFilter { $Uri -and $Uri -notmatch "/files"}
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '[{"filename":"Scripts/BuildScript.ps1", "status": "added"}]' } } -ParameterFilter { $Uri -and $Uri -match "/files"}
2023-09-05 11:40:42 +03:00
{
2023-02-13 15:32:16 +03:00
& $scriptPath `
-prBaseRepository "microsoft/AL-Go" `
-pullRequestId "123456" `
2023-09-05 11:40:42 +03:00
-token "ABC"
2023-02-13 15:32:16 +03:00
} | Should -Throw
}
It 'should fail if the PR is from a fork and removes a script' {
AppSource: Bug fixes, Publish dependencies and Documentation (#1027) ### Issues - ContainerName used during build was invalid if project names contained special characters - Issue 1009 by adding a includeDependencies property in DeliverToAppSource - Issue 997 'Deliver to AppSource' action fails for projects containing a space (or any special character) - Issue 987 Resource not accessible by integration when creating release from specific version - Issue 979 Publish to AppSource Documentation ### New Settings - `deliverToAppSource`: a JSON object containing the following properties - **productId** must be the product Id from partner Center. - **mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project. - **continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production. - **includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. Note that you need to set `generateDependencyArtifact` in the project settings file to true in order to include dependencies. ### Deprecated Settings - `appSourceContinuousDelivery` is moved to the `deliverToAppSource` structure - `appSourceMainAppFolder` is moved to the `deliverToAppSource` structure - `appSourceProductId` is moved to the `deliverToAppSource` structure Fixes #1009 Fixes #997 Fixes #987 Fixes #979 --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com>
2024-04-13 13:13:16 +03:00
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '{ "changed_files": 1 }' } } -ParameterFilter { $Uri -and $Uri -notmatch "/files"}
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '[{"filename":"Scripts/BuildScript.ps1","status":"removed"}]' } } -ParameterFilter { $Uri -and $Uri -match "/files"}
2023-09-05 11:40:42 +03:00
{
2023-02-13 15:32:16 +03:00
& $scriptPath `
-prBaseRepository "microsoft/AL-Go" `
-pullRequestId "123456" `
2023-09-05 11:40:42 +03:00
-token "ABC"
2023-02-13 15:32:16 +03:00
} | Should -Throw
}
It 'should fail if the PR is from a fork and changes the CODEOWNERS file' {
AppSource: Bug fixes, Publish dependencies and Documentation (#1027) ### Issues - ContainerName used during build was invalid if project names contained special characters - Issue 1009 by adding a includeDependencies property in DeliverToAppSource - Issue 997 'Deliver to AppSource' action fails for projects containing a space (or any special character) - Issue 987 Resource not accessible by integration when creating release from specific version - Issue 979 Publish to AppSource Documentation ### New Settings - `deliverToAppSource`: a JSON object containing the following properties - **productId** must be the product Id from partner Center. - **mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project. - **continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production. - **includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. Note that you need to set `generateDependencyArtifact` in the project settings file to true in order to include dependencies. ### Deprecated Settings - `appSourceContinuousDelivery` is moved to the `deliverToAppSource` structure - `appSourceMainAppFolder` is moved to the `deliverToAppSource` structure - `appSourceProductId` is moved to the `deliverToAppSource` structure Fixes #1009 Fixes #997 Fixes #987 Fixes #979 --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com>
2024-04-13 13:13:16 +03:00
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '{ "changed_files": 1 }' } } -ParameterFilter { $Uri -and $Uri -notmatch "/files"}
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '[{"filename":"CODEOWNERS","status":"modified"}]' } } -ParameterFilter { $Uri -and $Uri -match "/files"}
2023-09-05 11:40:42 +03:00
{
2023-02-13 15:32:16 +03:00
& $scriptPath `
-prBaseRepository "microsoft/AL-Go" `
-pullRequestId "123456" `
2023-09-05 11:40:42 +03:00
-token "ABC"
2023-02-13 15:32:16 +03:00
} | Should -Throw
}
It 'should fail if the PR is from a fork and changes anything in the .github folder' {
AppSource: Bug fixes, Publish dependencies and Documentation (#1027) ### Issues - ContainerName used during build was invalid if project names contained special characters - Issue 1009 by adding a includeDependencies property in DeliverToAppSource - Issue 997 'Deliver to AppSource' action fails for projects containing a space (or any special character) - Issue 987 Resource not accessible by integration when creating release from specific version - Issue 979 Publish to AppSource Documentation ### New Settings - `deliverToAppSource`: a JSON object containing the following properties - **productId** must be the product Id from partner Center. - **mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project. - **continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production. - **includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. Note that you need to set `generateDependencyArtifact` in the project settings file to true in order to include dependencies. ### Deprecated Settings - `appSourceContinuousDelivery` is moved to the `deliverToAppSource` structure - `appSourceMainAppFolder` is moved to the `deliverToAppSource` structure - `appSourceProductId` is moved to the `deliverToAppSource` structure Fixes #1009 Fixes #997 Fixes #987 Fixes #979 --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com>
2024-04-13 13:13:16 +03:00
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '{ "changed_files": 1 }' } } -ParameterFilter { $Uri -and $Uri -notmatch "/files"}
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '[{"filename":".github/Settings.json","status":"modified"}]' } } -ParameterFilter { $Uri -and $Uri -match "/files"}
2023-09-05 11:40:42 +03:00
{
& $scriptPath `
-prBaseRepository "microsoft/AL-Go" `
-pullRequestId "123456" `
2023-09-05 11:40:42 +03:00
-token "ABC"
} | Should -Throw
}
It 'should fail if the PR is from a fork and changes a yml file' {
AppSource: Bug fixes, Publish dependencies and Documentation (#1027) ### Issues - ContainerName used during build was invalid if project names contained special characters - Issue 1009 by adding a includeDependencies property in DeliverToAppSource - Issue 997 'Deliver to AppSource' action fails for projects containing a space (or any special character) - Issue 987 Resource not accessible by integration when creating release from specific version - Issue 979 Publish to AppSource Documentation ### New Settings - `deliverToAppSource`: a JSON object containing the following properties - **productId** must be the product Id from partner Center. - **mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project. - **continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production. - **includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. Note that you need to set `generateDependencyArtifact` in the project settings file to true in order to include dependencies. ### Deprecated Settings - `appSourceContinuousDelivery` is moved to the `deliverToAppSource` structure - `appSourceMainAppFolder` is moved to the `deliverToAppSource` structure - `appSourceProductId` is moved to the `deliverToAppSource` structure Fixes #1009 Fixes #997 Fixes #987 Fixes #979 --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com>
2024-04-13 13:13:16 +03:00
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '{ "changed_files": 1 }' } } -ParameterFilter { $Uri -and $Uri -notmatch "/files"}
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '[{"filename":".github/workflows/test.yaml","status":"modified"}]' } } -ParameterFilter { $Uri -and $Uri -match "/files"}
2023-09-05 11:40:42 +03:00
{
2023-02-13 15:32:16 +03:00
& $scriptPath `
-prBaseRepository "microsoft/AL-Go" `
-pullRequestId "123456" `
2023-09-05 11:40:42 +03:00
-token "ABC"
2023-02-13 15:32:16 +03:00
} | Should -Throw
}
It 'should succeed if the PR is from a fork and changes an .al file' {
AppSource: Bug fixes, Publish dependencies and Documentation (#1027) ### Issues - ContainerName used during build was invalid if project names contained special characters - Issue 1009 by adding a includeDependencies property in DeliverToAppSource - Issue 997 'Deliver to AppSource' action fails for projects containing a space (or any special character) - Issue 987 Resource not accessible by integration when creating release from specific version - Issue 979 Publish to AppSource Documentation ### New Settings - `deliverToAppSource`: a JSON object containing the following properties - **productId** must be the product Id from partner Center. - **mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project. - **continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production. - **includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. Note that you need to set `generateDependencyArtifact` in the project settings file to true in order to include dependencies. ### Deprecated Settings - `appSourceContinuousDelivery` is moved to the `deliverToAppSource` structure - `appSourceMainAppFolder` is moved to the `deliverToAppSource` structure - `appSourceProductId` is moved to the `deliverToAppSource` structure Fixes #1009 Fixes #997 Fixes #987 Fixes #979 --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com>
2024-04-13 13:13:16 +03:00
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '{ "changed_files": 1 }' } } -ParameterFilter { $Uri -and $Uri -notmatch "/files"}
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '[{"filename":"ALModule/Test.Codeunit.al","status":"modified"}]' } } -ParameterFilter { $Uri -and $Uri -match "/files"}
2023-02-13 15:32:16 +03:00
Mock Write-Host {}
& $scriptPath `
-prBaseRepository "microsoft/AL-Go" `
-pullRequestId "123456" `
2023-09-05 11:40:42 +03:00
-token "ABC"
2023-02-13 15:32:16 +03:00
Assert-MockCalled Write-Host -Exactly 1 -Scope It -ParameterFilter { $Object -eq "Verification completed successfully." }
}
It 'should succeed if the PR is from a fork and adds an .al file' {
AppSource: Bug fixes, Publish dependencies and Documentation (#1027) ### Issues - ContainerName used during build was invalid if project names contained special characters - Issue 1009 by adding a includeDependencies property in DeliverToAppSource - Issue 997 'Deliver to AppSource' action fails for projects containing a space (or any special character) - Issue 987 Resource not accessible by integration when creating release from specific version - Issue 979 Publish to AppSource Documentation ### New Settings - `deliverToAppSource`: a JSON object containing the following properties - **productId** must be the product Id from partner Center. - **mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project. - **continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production. - **includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. Note that you need to set `generateDependencyArtifact` in the project settings file to true in order to include dependencies. ### Deprecated Settings - `appSourceContinuousDelivery` is moved to the `deliverToAppSource` structure - `appSourceMainAppFolder` is moved to the `deliverToAppSource` structure - `appSourceProductId` is moved to the `deliverToAppSource` structure Fixes #1009 Fixes #997 Fixes #987 Fixes #979 --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com>
2024-04-13 13:13:16 +03:00
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '{ "changed_files": 1 }' } } -ParameterFilter { $Uri -and $Uri -notmatch "/files"}
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '[{"filename":"ALModule/Test.Codeunit.al","status":"added"}]' } } -ParameterFilter { $Uri -and $Uri -match "/files"}
2023-02-13 15:32:16 +03:00
Mock Write-Host {}
& $scriptPath `
-prBaseRepository "microsoft/AL-Go" `
-pullRequestId "123456" `
2023-09-05 11:40:42 +03:00
-token "ABC"
2023-02-13 15:32:16 +03:00
Assert-MockCalled Write-Host -Exactly 1 -Scope It -ParameterFilter { $Object -eq "Verification completed successfully." }
}
It 'should succeed if the PR is from a fork and removes an .al file' {
AppSource: Bug fixes, Publish dependencies and Documentation (#1027) ### Issues - ContainerName used during build was invalid if project names contained special characters - Issue 1009 by adding a includeDependencies property in DeliverToAppSource - Issue 997 'Deliver to AppSource' action fails for projects containing a space (or any special character) - Issue 987 Resource not accessible by integration when creating release from specific version - Issue 979 Publish to AppSource Documentation ### New Settings - `deliverToAppSource`: a JSON object containing the following properties - **productId** must be the product Id from partner Center. - **mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project. - **continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production. - **includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. Note that you need to set `generateDependencyArtifact` in the project settings file to true in order to include dependencies. ### Deprecated Settings - `appSourceContinuousDelivery` is moved to the `deliverToAppSource` structure - `appSourceMainAppFolder` is moved to the `deliverToAppSource` structure - `appSourceProductId` is moved to the `deliverToAppSource` structure Fixes #1009 Fixes #997 Fixes #987 Fixes #979 --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com>
2024-04-13 13:13:16 +03:00
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '{ "changed_files": 1 }' } } -ParameterFilter { $Uri -and $Uri -notmatch "/files"}
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '[{"filename":"ALModule/Test.Codeunit.al","status":"removed"}]' } } -ParameterFilter { $Uri -and $Uri -match "/files"}
2023-02-13 15:32:16 +03:00
Mock Write-Host {}
& $scriptPath `
-prBaseRepository "microsoft/AL-Go" `
-pullRequestId "123456" `
2023-09-05 11:40:42 +03:00
-token "ABC"
2023-02-13 15:32:16 +03:00
Assert-MockCalled Write-Host -Exactly 1 -Scope It -ParameterFilter { $Object -eq "Verification completed successfully." }
}
It 'should fail if the PR is from a fork and changes more than 3000 files' {
AppSource: Bug fixes, Publish dependencies and Documentation (#1027) ### Issues - ContainerName used during build was invalid if project names contained special characters - Issue 1009 by adding a includeDependencies property in DeliverToAppSource - Issue 997 'Deliver to AppSource' action fails for projects containing a space (or any special character) - Issue 987 Resource not accessible by integration when creating release from specific version - Issue 979 Publish to AppSource Documentation ### New Settings - `deliverToAppSource`: a JSON object containing the following properties - **productId** must be the product Id from partner Center. - **mainAppFolder** specifies the appFolder of the main app if you have multiple apps in the same project. - **continuousDelivery** can be set to true to enable continuous delivery of every successful build to AppSource Validation. Note that the app will only be in preview in AppSource and you will need to manually press GO LIVE in order for the app to be promoted to production. - **includeDependencies** can be set to an array of file names (incl. wildcards) which are the names of the dependencies to include in the AppSource submission. Note that you need to set `generateDependencyArtifact` in the project settings file to true in order to include dependencies. ### Deprecated Settings - `appSourceContinuousDelivery` is moved to the `deliverToAppSource` structure - `appSourceMainAppFolder` is moved to the `deliverToAppSource` structure - `appSourceProductId` is moved to the `deliverToAppSource` structure Fixes #1009 Fixes #997 Fixes #987 Fixes #979 --------- Co-authored-by: freddydk <freddydk@users.noreply.github.com>
2024-04-13 13:13:16 +03:00
Mock -CommandName Invoke-WebRequest -MockWith { @{"Content" = '{ "changed_files": 5001 }' } } -ParameterFilter { $Uri -and $Uri -notmatch "/files"}
2023-09-05 11:40:42 +03:00
{
& $scriptPath `
-prBaseRepository "microsoft/AL-Go" `
-pullRequestId "123456" `
2023-09-05 11:40:42 +03:00
-token "ABC"
} | Should -Throw
}
2023-02-13 15:32:16 +03:00
It 'Compile Action' {
Invoke-Expression $actionScript
}
It 'Test action.yaml matches script' {
$permissions = [ordered]@{
}
$outputs = [ordered]@{
}
YamlTest -scriptRoot $scriptRoot -actionName $actionName -actionScript $actionScript -permissions $permissions -outputs $outputs
}
}