| name | run-tests |
| description | Run specific AL test codeunits against an existing Business Central container. Requires a running container and at least one filter (codeunit ID, range, function, or extension ID) — will not run all tests. |
run-tests
Runs specific test codeunits against a running BC container via Run-TestsInBcContainer. Requires at least one filter — refuses to run without one to prevent accidentally executing the full test suite.
When to use
- After publishing AL changes to a container, to verify specific tests pass.
- When the user asks to "run test 132985", "test the SharePoint codeunit", etc.
- As a follow-up to
/compile-system-app when the user wants runtime validation beyond compile.
Prerequisites
- A running BC container with apps already published (e.g., created via
build\scripts\DevEnv\NewDevEnv.ps1).
BcContainerHelper module installed.
- The script will prompt for the container admin password.
How to run
pwsh -File ".claude/skills/run-tests/Run-SystemAppTests.ps1" -TestCodeunit 132985
Filter options (at least one required)
| Flag | Example | What it does |
|---|
-TestCodeunit | 132985 or 132985,139620 | Run specific codeunit(s) by ID |
-TestCodeunitRange | "132980..132990" | Run a range of codeunit IDs |
-TestFunction | "TestGetListItems" | Run a single test function (combine with -TestCodeunit) |
-ExtensionId | "7be20e0e-..." | Run all tests from an extension |
Other flags
| Flag | Default | Description |
|---|
-ContainerName | bcserver | Target container |
-UserName | admin | Container admin user |
-Detailed | off | Verbose test output |
-DisableTestIsolation | off | Use test runner 130451 (no isolation) |
-MaxRetries | 1 | Set to 2+ to auto-retry failed tests |
Examples
pwsh -File ".claude/skills/run-tests/Run-SystemAppTests.ps1" -TestCodeunit 132985
pwsh -File ".claude/skills/run-tests/Run-SystemAppTests.ps1" -TestCodeunit 132985,139620
pwsh -File ".claude/skills/run-tests/Run-SystemAppTests.ps1" -TestCodeunit 132985 -TestFunction "TestGetListItemsByListTitle"
pwsh -File ".claude/skills/run-tests/Run-SystemAppTests.ps1" -TestCodeunitRange "132980..132990" -MaxRetries 2 -Detailed
What to expect
Finding codeunit IDs
To find the codeunit ID for a test, look at the .al file header:
codeunit 132985 "SharePoint Graph Advanced Test"
The number after codeunit is the ID to pass to -TestCodeunit.