run-al-tests

$npx mdskill add microsoft/AL/run-al-tests

Runs published AL test codeunits against a BCInsider sandbox via prerelease ALTool.

  • Solves running AL tests against a provisioned sandbox without manual setup.
  • Depends on verify-prerelease-altool, publish-al-app, and ALTool with BC environment variables.
  • Uses the provided codeunit ID, project folder, and optional test methods to construct the runtests command.
  • Returns JSON response with passed, failed, and skipped counts, preserving the native exit code.

SKILL.md

.github/skills/run-al-testsView on GitHub ↗
---
name: run-al-tests
description: Runs a published AL test codeunit against the provisioned BCInsider sandbox through the public prerelease ALTool.
argument-hint: "<codeunit-id> [project-folder] [test-methods]"
---

1. Invoke `verify-prerelease-altool`.
2. Publish the test app with `publish-al-app`.
3. Run structured tests:
   ```powershell
   & $env:ALTOOL_PATH runtests $codeunitId `
       --project $projectPath `
       --server $env:BC_SERVER_URL `
       --serverinstance $env:BC_SERVER_INSTANCE `
       --port $env:BC_SERVER_PORT `
       --tenant $env:BC_TENANT `
       --authentication $env:BC_AUTHENTICATION `
       --environmenttype OnPrem
   ```
4. Add `--testmethods` only when specific procedures are requested.
5. Preserve the JSON response and native exit code; report passed, failed, and skipped counts.

More from microsoft/AL