Skip to content

Commit 8e1121a

Browse files
authored
[Suggestion] Add the ability to compile all test apps in one job and run the tests in a following job (microsoft#2066)
### ❔What, Why & How <!-- Include description of the changes that will help reviewers in their task --> We're trying to see if we can adjust our build graph such that we can compile everything in the first build matrix and then run all test tests in the following build matrix. However, currently it seems that AL-Go won't run tests for test apps downloaded as dependencies (from another job). This PR would add the ability to change that (as a preview feature). This may be something we'd change later on though Related to [AB#613617](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/613617) ### ✅ Checklist - [ ] Add tests (E2E, unit tests) - [x] Update RELEASENOTES.md - [x] Update documentation (e.g. for new settings or scenarios) - [ ] Add telemetry <!-- Include more checklist entries, if needed -->
1 parent e4815c9 commit 8e1121a

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎Actions/.Modules/ReadSettings.psm1‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ function GetDefaultSettings
148148
"installApps" = @()
149149
"installTestApps" = @()
150150
"installOnlyReferencedApps" = $true
151+
"runTestsInAllInstalledTestApps" = $false
151152
"generateDependencyArtifact" = $false
152153
"skipUpgrade" = $false
153154
"applicationDependency" = "18.0.0.0"

‎Actions/.Modules/settings.schema.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@
241241
"type": "boolean",
242242
"description": "Install only referenced apps. See https://aka.ms/ALGoSettings#installonlyreferencedapps"
243243
},
244+
"runTestsInAllInstalledTestApps": {
245+
"type": "boolean",
246+
"description": "PREVIEW: Run tests in all installed test apps. See https://aka.ms/ALGoSettings#runTestsInAllInstalledTestApps"
247+
},
244248
"generateDependencyArtifact": {
245249
"type": "boolean",
246250
"description": "See https://aka.ms/ALGoSettings#generatedependencyartifact"

‎Actions/RunPipeline/RunPipeline.ps1‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ try {
209209
}
210210
}
211211

212+
if ($settings.runTestsInAllInstalledTestApps) {
213+
# Trim parentheses from test apps. Run-ALPipeline will skip running tests in test apps wrapped in ()
214+
$install.TestApps = $install.TestApps | ForEach-Object { $_.TrimStart("(").TrimEnd(")") }
215+
}
216+
212217
# Replace secret names in install.apps and install.testApps
213218
foreach($list in @('Apps','TestApps')) {
214219
$install."$list" = @($install."$list" | ForEach-Object {
@@ -237,6 +242,7 @@ try {
237242

238243
# Analyze InstallApps and InstallTestApps before launching pipeline
239244

245+
240246
# Check if codeSignCertificateUrl+Password is used (and defined)
241247
if (!$settings.doNotSignApps -and $codeSignCertificateUrl -and $codeSignCertificatePassword -and !$settings.keyVaultCodesignCertificateName) {
242248
OutputWarning -message "Using the legacy CodeSignCertificateUrl and CodeSignCertificatePassword parameters. Consider using the new Azure Keyvault signing instead. Go to https://aka.ms/ALGoSettings#keyVaultCodesignCertificateName to find out more"

‎Scenarios/settings.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ The repository settings are only read from the repository settings file (.github
103103
| <a id="adminCenterApiCredentialsSecretName"></a>adminCenterApiCredentialsSecretName | Specifies the name (**NOT the secret**) of the adminCenterApiCredentials secret. Default is adminCenterApiCredentials. AL-Go for GitHub will look for a secret with this name in GitHub Secrets or Azure KeyVault to use when connecting to the Admin Center API when creating Online Development Environments. Read [this](CreateOnlineDevEnv2.md) for more information. | AdminCenterApiCredentials |
104104
| <a id="installApps"></a>installApps | An array of 3rd party dependency apps, which you do not have access to through the appDependencyProbingPaths. The setting should be an array of either secure URLs or paths to folders or files relative to the project, where the CI/CD workflow can find and download the apps. The apps in installApps are downloaded and installed before compiling and installing the apps.<br/>**Note:** If you specify ${{SECRETNAME}} as part of a URL, it will be replaced by the value of the secret SECRETNAME. | [ ] |
105105
| <a id="installTestApps"></a>installTestApps | An array of 3rd party dependency apps, which you do not have access to through the appDependencyProbingPaths. The setting should be an array of either secure URLs or paths to folders or files relative to the project, where the CI/CD workflow can find and download the apps. The apps in installTestApps are downloaded and installed before compiling and installing the test apps. Adding a parentheses around the setting indicates that the test in this app will NOT be run, only installed.<br/>**Note:** If you specify ${{SECRETNAME}} as part of a URL, it will be replaced by the value of the secret SECRETNAME. | [ ] |
106+
| <a id="runTestsInAllInstalledTestApps"></a>runTestsInAllInstalledTestApps | PREVIEW: By default AL-Go will publish test apps built in previous jobs within the workflow but will not execute the tests. By setting this to true, AL-Go will start running tests in all the test apps produced by previous jobs | false |
106107
| <a id="configPackages"></a>configPackages | An array of configuration packages to be applied to the build container before running tests. Configuration packages can be the relative path within the project or it can be STANDARD, EXTENDED or EVALUATION for the rapidstart packages, which comes with Business Central. | [ ] |
107108
| <a id="configPackages.country"></a>configPackages.country | An array of configuration packages to be applied to the build container for country **country** before running tests. Configuration packages can be the relative path within the project or it can be STANDARD, EXTENDED or EVALUATION for the rapidstart packages, which comes with Business Central. | [ ] |
108109
| <a id="installOnlyReferencedApps"></a>installOnlyReferencedApps | By default, only the apps referenced in the dependency chain of your apps will be installed when inspecting the settings: InstallApps, InstallTestApps and appDependencyProbingPath. If you change this setting to false, all apps found will be installed. | true |

0 commit comments

Comments
 (0)