AL Runner

Command line reference

This page covers the flags you are likely to reach for. al-runner --help is the complete, authoritative list and is generated from the code, so prefer it whenever the two disagree.

al-runner [OPTIONS] <bundle-dir>...

Choosing what runs

FlagEffect
--test PATTERN, --filter PATTERNRun only tests whose qualified name (CodeunitNNNN.Method) contains PATTERN, case-insensitively.
--isolation MODEcodeunit (default), test, or disabled. See Writing tests.
--test-timeout SECONDSPer-test timeout. Default 60.

Resolving dependencies

FlagEffect
--package-cache PATHAn extra .app package cache directory. Repeatable.
--test-data, --test-data=PATHHydrate the database from a Business Central backup. Needs the bcbak reader.
--test-data-company NAMEWhich company inside the backup to use. Defaults to the first one.

Speed

FlagEffect
--cache PATHCache compiled AL output between runs.
--watchStay resident and re-run on every .al change.
--jobs N, -j NRun the given bundles across N worker processes. Also bounds memory: peak usage tracks how many bundles a process loads, not how many tests it runs.
--serverLong-running JSON-RPC daemon over stdin and stdout, for editor integrations.

Output

FlagEffect
--output-junit PATHWrite a JUnit XML report, grouped by codeunit.
--output-jsonPer-test JSON on stdout instead of the normal text output.
--coverageStatement-level coverage using Business Central’s own instrumentation. Writes Cobertura XML.
--failures-only, --quietPrint only failures.
--verboseShow internal diagnostic logs.
--no-strict-exitAlways exit 0, so a caller can parse the output without the step failing.

Debugging

FlagEffect
--dap [PORT]Debug Adapter Protocol server, default port 4711: set AL breakpoints, pause, inspect locals. Needs exactly one bundle.
--dump-csharp DIRWrite the intermediate C# that Business Central’s compiler emitted, one file per AL object.

Exit codes

CodeMeaning
0Every test passed.
1At least one test failed or errored.
2A bundle could not execute — a process-level error, or a bad invocation such as an unknown flag or a path that does not exist.
3A bundle could not compile.
4A suite’s test or app-group count did not match its declared baseline (--count-baseline).
5An expectations entry matched no test in this run (--expectations-require-match).

Environment variables

AL_RUNNER_VERBOSE=1 and AL_RUNNER_SHOW_PASS=1 mirror the flags of the same name. AL_RUNNER_BCBAK points at the backup reader used by --test-data. AL_RUNNER_ARTIFACTS_ROOT moves the Business Central artifact cache off your home directory, which is useful when it has to live on another volume or on a CI runner’s mounted path.