AL-Go icon indicating copy to clipboard operation
AL-Go copied to clipboard

Support using an online environment for testing when building apps

Open freddydk opened this issue 9 months ago • 0 comments

This PR adds support for using an online environment for running tests when building apps. If you are building a PTE with dependencies to 3rd party appsource apps, you might not have access to runtime packages for these AppSource apps and hence, you might not be able to run tests for your PTE.

Using an online environment for CI/CD or potentially a scheduled Test Current workflow, allows you to run tests for your PTE.

New Workflow specific settings

  • buildEnvironmentName - should be the Business Central environment name (from the Admin Center) for the environment you want to use if you want to run tests using online environments. Note that you also need to create a buildAuthContext secret, which gives access to this environment.

Use online environment during build for running tests

By creating a buildAuthContext secret and setting the buildEnvironmentName for a specific branch and a specific workflow, will cause AL-Go for GitHub to use this environment for running tests. An example of how to define these settings could be:

  "useCompilerFolder": true,
  "doNotPublishApps": true,
  "conditionalSettings": [
    {
      "workflows": [ "CICD" ],
      "branches": [ "main" ],
      "settings": {
        "doNotPublishApps": false,
        "buildEnvironmentName": "cicd",
        "buildAuthContextSecretName": "cicdAuthContext",
        "workflowConcurrency": [ "group: ${{ github.workflow }}-${{ github.ref }}", "cancel-in-progress: false" ]
      }
    }
  ]

freddydk avatar Mar 26 '25 21:03 freddydk