Skip to content

Commit

Permalink
Merge branch 'main' into issue1215
Browse files Browse the repository at this point in the history
  • Loading branch information
freddydk authored Oct 28, 2024
2 parents 3d185ae + 754f321 commit 3ccea30
Show file tree
Hide file tree
Showing 53 changed files with 177 additions and 147 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
Test:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Run Tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CleanupTempRepos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
outputs:
githubOwner: ${{ steps.check.outputs.githubOwner }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Check secrets
id: check
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
runs-on: [ ubuntu-latest ]
needs: [ Check ]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Remove Temp Repositories
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
}
}
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Deploy
env:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/E2E.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
maxParallel: ${{ steps.check.outputs.maxParallel }}
githubOwner: ${{ steps.check.outputs.githubOwner }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Check secrets
id: check
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
perTenantExtensionRepo: ${{ steps.setup.outputs.perTenantExtensionRepo }}
appSourceAppRepo: ${{ steps.setup.outputs.appSourceAppRepo }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref }}

Expand All @@ -111,7 +111,7 @@ jobs:
releases: ${{ steps.Analyze.outputs.releases }}
scenarios: ${{ steps.Analyze.outputs.scenarios }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref }}

Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
if: github.event.inputs.runScenarios == 'true'
strategy: ${{ fromJson(needs.Analyze.outputs.scenarios) }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref }}

Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
if: github.event.inputs.runScenarios == 'true'
strategy: ${{ fromJson(needs.Analyze.outputs.scenarios) }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref }}

Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
if: github.event.inputs.runTestMatrix == 'true'
strategy: ${{ fromJson(needs.Analyze.outputs.publictestruns) }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref }}

Expand Down Expand Up @@ -292,7 +292,7 @@ jobs:
if: github.event.inputs.runTestMatrix == 'true' && github.event.inputs.includePrivateRepos == 'true'
strategy: ${{ fromJson(needs.Analyze.outputs.privatetestruns) }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref }}

Expand Down Expand Up @@ -336,7 +336,7 @@ jobs:
if: github.event.inputs.runUpgradeTests == 'true'
strategy: ${{ fromJson(needs.Analyze.outputs.releases) }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref }}

Expand Down Expand Up @@ -376,7 +376,7 @@ jobs:
needs: [ Check, SetupRepositories, TestAlGoPublic, TestAlGoPrivate, TestAlGoUpgrade, ScenariosOnWindows, ScenariosOnLinux ]
if: always() && (!Cancelled()) && (needs.SetupRepositories.result == 'Success') && (needs.TestAlGoPublic.result == 'Success' || needs.TestAlGoPublic.result == 'Skipped') && (needs.TestAlGoPrivate.result == 'Success' || needs.TestAlGoPrivate.result == 'Skipped') && (needs.TestAlGoUpgrade.result == 'Success' || needs.TestAlGoUpgrade.result == 'Skipped') && (needs.Scenario.result == 'Success' || needs.Scenario.result == 'Skipped')
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref }}

Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/jekyll-gh-pages.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/powershell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f # v1.1
Expand All @@ -31,6 +31,6 @@ jobs:

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
sarif_file: results.sarif
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
pre-commit:
runs-on: windows-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
extra_args: --all-files
3 changes: 3 additions & 0 deletions Actions/AL-Go-Helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,8 @@ function ReadSettings {
"testDependencies" = @()
"testFolders" = @()
"bcptTestFolders" = @()
"pageScriptingTests" = @()
"restoreDatabases" = @()
"installApps" = @()
"installTestApps" = @()
"installOnlyReferencedApps" = $true
Expand All @@ -606,6 +608,7 @@ function ReadSettings {
"doNotBuildTests" = $false
"doNotRunTests" = $false
"doNotRunBcptTests" = $false
"doNotRunPageScriptingTests" = $false
"doNotPublishApps" = $false
"doNotSignApps" = $false
"configPackages" = @()
Expand Down
2 changes: 1 addition & 1 deletion Actions/CalculateArtifactNames/CalculateArtifactNames.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ else {
$suffix = "$($settings.repoVersion).$($settings.appBuild).$($settings.appRevision)"
}

'Apps', 'Dependencies', 'TestApps', 'TestResults', 'BcptTestResults', 'BuildOutput', 'ContainerEventLog', 'PowerPlatformSolution' | ForEach-Object {
'Apps', 'Dependencies', 'TestApps', 'TestResults', 'BcptTestResults', 'PageScriptingTestResults', 'PageScriptingTestResultDetails', 'BuildOutput', 'ContainerEventLog', 'PowerPlatformSolution' | ForEach-Object {
$name = "$($_)ArtifactsName"
$value = "$($projectName)-$($branchName)-$buildMode$_-$suffix"
Set-OutputVariable -name $name -value $value
Expand Down
2 changes: 2 additions & 0 deletions Actions/CalculateArtifactNames/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ none
| TestAppsArtifactsName | Artifacts name for TestApps |
| TestResultsArtifactsName | Artifacts name for TestResults |
| BcptTestResultsArtifactsName | Artifacts name for BcptTestResults |
| PageScriptingTestResultsArtifactsName | Artifacts name for PageScriptingTestResults |
| PageScriptingTestResultDetailsArtifactsName | Artifacts name for PageScriptingTestResultDetails |
| BuildOutputArtifactsName | Artifacts name for BuildOutput |
| ContainerEventLogArtifactsName | Artifacts name for ContainerEventLog |
| BuildMode | Build mode used when building the artifacts |
6 changes: 6 additions & 0 deletions Actions/CalculateArtifactNames/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ outputs:
BcptTestResultsArtifactsName:
description: Artifacts name for BcptTestResults
value: ${{ steps.calculateartifactnames.outputs.BcptTestResultsArtifactsName }}
PageScriptingTestResultsArtifactsName:
description: Artifacts name for PageScriptingTestResults
value: ${{ steps.calculateartifactnames.outputs.PageScriptingTestResultsArtifactsName }}
PageScriptingTestResultDetailsArtifactsName:
description: Artifacts name for PageScriptingTestResultDetails
value: ${{ steps.calculateartifactnames.outputs.PageScriptingTestResultDetailsArtifactsName }}
BuildOutputArtifactsName:
description: Artifacts name for BuildOutput
value: ${{ steps.calculateartifactnames.outputs.BuildOutputArtifactsName }}
Expand Down
5 changes: 5 additions & 0 deletions Actions/RunPipeline/RunPipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ try {
"doNotBuildTests",
"doNotRunTests",
"doNotRunBcptTests",
"doNotRunPageScriptingTests",
"doNotPublishApps",
"installTestRunner",
"installTestFramework",
Expand Down Expand Up @@ -414,6 +415,8 @@ try {
-appFolders $settings.appFolders `
-testFolders $settings.testFolders `
-bcptTestFolders $settings.bcptTestFolders `
-pageScriptingTests $settings.pageScriptingTests `
-restoreDatabases $settings.restoreDatabases `
-buildOutputFile $buildOutputFile `
-containerEventLogFile $containerEventLogFile `
-testResultsFile $testResultsFile `
Expand All @@ -428,6 +431,8 @@ try {
-additionalCountries $additionalCountries `
-obsoleteTagMinAllowedMajorMinor $settings.obsoleteTagMinAllowedMajorMinor `
-buildArtifactFolder $buildArtifactFolder `
-pageScriptingTestResultsFile (Join-Path $buildArtifactFolder 'PageScriptingTestResults.xml') `
-pageScriptingTestResultsFolder (Join-Path $buildArtifactFolder 'PageScriptingTestResultDetails') `
-CreateRuntimePackages:$CreateRuntimePackages `
-appBuild $appBuild -appRevision $appRevision `
-uninstallRemovedApps
Expand Down
13 changes: 13 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
- Issue 1241 Increment Version Number might produce wrong app.json
- `deployTo<environment>` now has an additional property called DependencyInstallMode, which determines how dependencies are deployed if GenerateDependencyArtifact is true. Default value is `install` to install dependencies if not already installed. Other values are `ignore` for ignoring dependencies, `upgrade` for upgrading dependencies if possible and `forceUpgrade` for force upgrading dependencies.

### Support for Page Scripting Tests

Page Scripting tests are now supported as part of CI/CD. By specifying pageScriptingTests in your project settings file, AL-Go for GitHub will automatically run these page scripting tests as part of your CI/CD workflow, generating the following build artifacts:

- `PageScriptingTestResults` is a JUnit test results file with all results combined.
- `PageScriptingTestResultDetails` are the detailed test results (including videos) when any of the page scripting tests have failures. If the page scripting tests succeed - the details are not published.

### New Project Settings

- `pageScriptingTests` should be an array of page scripting test file specifications, relative to the AL-Go project. Examples of file specifications: `recordings/my*.yml` (for all yaml files in the recordings subfolder matching my\*.yml), `recordings` (for all \*.yml files in the recordings subfolder) or `recordings/test.yml` (for a single yml file)
- `doNotRunPageScriptingTests` can force the pipeline to NOT run the page scripting tests specified in pageScriptingTests. Note this setting can be set in a [workflow specific settings file](#where-are-the-settings-located) to only apply to that workflow
- `restoreDatabases` should be an array of events, indicating when you want to start with clean databases in the container. Possible events are: `BeforeBcpTests`, `BeforePageScriptingTests`, `BeforeEachTestApp`, `BeforeEachBcptTestApp`, `BeforeEachPageScriptingTest`

## v6.0

### Issues
Expand Down
6 changes: 6 additions & 0 deletions Scenarios/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ When running a workflow or a local script, the settings are applied by reading s
| <a id="appFolders"></a>appFolders | appFolders should be an array of folders (relative to project root), which contains apps for this project. Apps in these folders are sorted based on dependencies and built and published in that order.<br />If appFolders are not specified, AL-Go for GitHub will try to locate appFolders in the root of the project. | \[ \] |
| <a id="testFolders"></a>testFolders | testFolders should be an array of folders (relative to project root), which contains test apps for this project. Apps in these folders are sorted based on dependencies and built, published and tests are run in that order.<br />If testFolders are not specified, AL-Go for GitHub will try to locate testFolders in the root of the project. | \[ \] |
| <a id="bcptTestFolders"></a>bcptTestFolders | bcptTestFolders should be an array of folders (relative to project root), which contains performance test apps for this project. Apps in these folders are sorted based on dependencies and built, published and bcpt tests are run in that order.<br />If bcptTestFolders are not specified, AL-Go for GitHub will try to locate bcptTestFolders in the root of the project. | \[ \] |
| <a id="pageScriptingTests"></a>pageScriptingTests | pageScriptingTests should be an array of page scripting test file specifications, relative to the AL-Go project. Examples of file specifications: `recordings/my*.yml` (for all yaml files in the recordings subfolder matching my\*.yml), `recordings` (for all \*.yml files in the recordings subfolder) or `recordings/test.yml` (for a single yml file) | \[ \] |
| <a id="doNotRunpageScriptingTests"></a>doNotRunpageScriptingTests | When true, this setting forces the pipeline to NOT run the page scripting tests specified in pageScriptingTests. Note this setting can be set in a [workflow specific settings file](#where-are-the-settings-located) to only apply to that workflow | false |
| <a id="restoreDatabases"></a>restoreDatabases | restoreDatabases should be an array of events, indicating when you want to start with clean databases in the container. Possible events are: `BeforeBcpTests`, `BeforePageScriptingTests`, `BeforeEachTestApp`, `BeforeEachBcptTestApp`, `BeforeEachPageScriptingTest` | \[ \] |
| <a id="appDependencyProbingPaths"></a>appDependencyProbingPaths | Array of dependency specifications, from which apps will be downloaded when the CI/CD workflow is starting. Every dependency specification consists of the following properties:<br />**repo** = repository<br />**version** = version (default latest)<br />**release_status** = latestBuild/release/prerelease/draft (default release)<br />**projects** = projects (default * = all)<br />**branch** = branch (default main)<br />**AuthTokenSecret** = Name of secret containing auth token (default none)<br /> | \[ \] |
| <a id="cleanModePreprocessorSymbols"></a>cleanModePreprocessorSymbols | List of clean tags to be used in _Clean_ build mode | \[ \] |
| <a id="bcptThresholds"></a>bcptThresholds | Structure with properties for the thresholds when running performance tests using the Business Central Performance Toolkit.<br />**DurationWarning** = a warning is shown if the duration of a bcpt test degrades more than this percentage (default 10)<br />**DurationError** - an error is shown if the duration of a bcpt test degrades more than this percentage (default 25)<br />**NumberOfSqlStmtsWarning** - a warning is shown if the number of SQL statements from a bcpt test increases more than this percentage (default 5)<br />**NumberOfSqlStmtsError** - an error is shown if the number of SQL statements from a bcpt test increases more than this percentage (default 10)<br />*Note that errors and warnings on the build in GitHub are only issued when a threshold is exceeded on the codeunit level, when an individual operation threshold is exceeded, it is only shown in the test results viewer.* |
Expand Down Expand Up @@ -312,6 +315,9 @@ This functionality is also available in AL-Go for GitHub, by adding a file to th
| GetBcContainerAppRuntimePackage.ps1 | Get the runtime package specified by the $parameters hashtable |
| RemoveBcContainer.ps1 | Cleanup based on the $parameters hashtable |
| InstallMissingDependencies | Install missing dependencies |
| BackupBcContainerDatabases | Backup Databases in container for subsequent restore(s) |
| RestoreDatabasesInBcContainer | Restore Databases in container |
| InstallMissingDependencies | Install missing dependencies |

## BcContainerHelper settings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
shell: powershell

- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Initialize the workflow
id: init
Expand Down
Loading

0 comments on commit 3ccea30

Please sign in to comment.