Skip to content

Let the caller choose the test runner codeunit - #200

Merged
StefanMaron merged 1 commit into
masterfrom
feat/test-runner-codeunit
Oct 31, 2026
Merged

StefanMaron merged 1 commit into
masterfrom
feat/test-runner-codeunit

Conversation

@StefanMaron

Copy link
Copy Markdown
Collaborator

Fixes #193.

What changes

  • Table 99903 gets a field TestRunnerId (Test Runner Extension 3.3.0.0). SetupSuite and SetupSuiteAppend give the DEFAULT suite that runner. 0 keeps 130450 "Test Runner - Isol. Codeunit", which was hardcoded before.
  • run-tests.sh --test-runner-codeunit <id>. The id is only sent when set, so the default run still works against an older image.
  • test_runner_codeunit_id input on bc-test-from-source.yml and bc-test-prebuilt.yml. The TestRunnerHub runs tests without a runner codeunit. So when the input is set, bc-test-from-source.yml sends every codeunit to the websocket runner, and test_runner=altool fails with a clear error.
  • Results come back in the same JUnit format, because they are read from Test Method Line as before.

Checked on BC 28.4, with a test app that has its own Subtype = TestRunner codeunit (a copy of 130450 that counts OnBeforeTestRun calls) and a test that passes only when that runner ran:

  • --test-runner-codeunit 70190: passes.
  • No flag, and --test-runner-codeunit 130451: fails, as expected.
  • A runner id that does not exist: the run fails with BC's "An object with that ID does not exist", exit code 1.
  • Smoke codeunits 70000, 70001, 70040, 70075 with the default runner: 19 passed.

Not included: a CI job that runs a suite through a custom runner. It would need its own BC boot per version. I can add one if you want it guarded in CI.

The rebuilt TestRunnerExtension.app was compiled with AL 17 against BC 28.4 symbols, at runtime 16.0 as before. The BC 27 leg of the version matrix checks that it still publishes there.

https://claude.ai/code/session_01B5GPNVNEoh5CSGzgTPEthD

The websocket runner ran every suite through 130450 "Test Runner - Isol.
Codeunit", hardcoded in SetupSuite. A new field TestRunnerId on table 99903
(Test Runner Extension 3.3.0.0) sets the suite's "Test Runner Id" instead;
0 keeps 130450. run-tests.sh takes --test-runner-codeunit <id>, and both
reusable workflows take test_runner_codeunit_id. The hub runs tests without a
runner codeunit, so with the input set bc-test-from-source.yml sends every
codeunit to the websocket runner and test_runner=altool fails.

The id is only sent when set, so the default run still works against an
older image.

Checked on BC 28.4 with a test app that has its own Subtype = TestRunner
codeunit and a test that passes only when that runner's OnBeforeTestRun ran:
passes with --test-runner-codeunit 70190, fails without it and with 130451.
A runner id that does not exist fails the run with BC's error. Smoke
codeunits 70000, 70001, 70040, 70075 with the default runner: 19 passed.

Claude-Session: https://claude.ai/code/session_01B5GPNVNEoh5CSGzgTPEthD
@StefanMaron
StefanMaron merged commit b609e57 into master Oct 31, 2026
20 of 21 checks passed
@StefanMaron
StefanMaron deleted the feat/test-runner-codeunit branch October 31, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test workflow: let the caller choose the test runner codeunit (for example 130450 or an app's own runner)

1 participant