Skip to content

Run disabled-isolation tests in a second app-level phase - #13738

Open
Alexander Holstrup (aholstrup1) wants to merge 6 commits into
mainfrom
aholstrup1-app-level-disabled-isolation-tests
Open

Alexander Holstrup (aholstrup1) wants to merge 6 commits into
mainfrom
aholstrup1-app-level-disabled-isolation-tests

Conversation

@aholstrup1

@aholstrup1 Alexander Holstrup (aholstrup1) commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: f4caf28b48e33243c588fbdafd260b97e5675744

Dimension Assessment Rationale
Change confidence 8/10 ↑ Earlier CI logs confirm two-phase ordering and retained executed US test identities.
↑ 218 scheduler, routing, AU-exclusion, churn and tolerance tests pass after merging main; analyzer findings unchanged versus main.
↑ Opus long-context review found no merge-introduced issues; GitHub confirms conflicts cleared.
↓ Fresh CI is running; merged churn integration and AU exclusions have not been validated in BC.
↓ Two AU methods remain intentionally omitted, not fixed.

What & why

Run tests in two passes: Codeunit-isolated tests first, then Disabled-isolation tests after all first-pass work and retries finish. Both passes use the existing app-level parallel queue, and BcContainerHelper selects the matching tests for each app.

This removes the separate discovery loop and database restores between codeunits, bringing execution closer to NAV and reducing overhead. Normal setup/cleanup, exclusions, retries and result merging are preserved. Legacy still runs a single pass.

Temporarily exclude only TestGetGLEntries in APIV1 codeunit 139730 and APIV2 codeunit 139830 for AU. The existing JSON exclusion loader now accepts an optional country field; entries without it retain their global behavior. Other countries and methods remain enabled.

Linked work

AB#658158

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)

  • After the November 26 main merge, 125 scheduler, routing and tolerance tests passed. No additional analyzer findings compared with main; Opus found no merge-introduced issues.
  • Earlier CI logs confirmed the two-pass order and retained executed test identities in the three US buckets. Across 113 matched test jobs, occupied runner time fell by about 13%; this was an observational comparison, not a controlled benchmark.
  • For the AU exclusions: Import-Module Pester -RequiredVersion 5.7.1; Invoke-Pester -Path build\scripts\tests\ParallelTestExecution.Test.ps1 -PassThru — 72 passed, 0 failed. Covers exact methods from the real JSON, AU/au matching, non-AU and missing-country exclusion avoidance, unchanged global entries, and country forwarding in both phases. Analyzer findings unchanged versus the previous head; Opus long-context review found no actionable issues.
  • After resolving the November 27 main merge: Import-Module Pester -RequiredVersion 5.7.1; Invoke-Pester -Path build\scripts\tests\ParallelTestExecution.Test.ps1,build\scripts\tests\BuildOptimization.Test.ps1,build\scripts\TestTolerance\TestTolerance.Test.ps1 -PassThru — 218 passed, 0 failed. Main's churn proposal remains logging-only: both phases run the full bucket. Legacy, cache behavior, empty proposals and full-run fallbacks are covered. Opus long-context review found no merge-introduced issues; no additional analyzer findings versus main.
  • git -c core.longpaths=true diff --check origin/main -- .github\AL-Go-Settings.json build\scripts src\DisabledTests — passed before committing the merge.
  • No local Business Central container run. The earlier refreshed-branch run still failed both AU methods before these exclusions. Conflicts with main are now resolved; fresh CI is running, so runtime confirmation remains pending.

Risk & compatibility

Disabled-isolation tests now share existing tenant data between runs. They must manage their own fixtures rather than rely on a clean database. The two temporary AU method exclusions leave a coverage gap for VAT-fixture compatibility; they do not fix the underlying failures. Earlier same-app invoice posting is a candidate writer, not a proven cause. No database resets or fixture changes are introduced. The obsolete enableCleanTestCodeunitExecution setting is removed. No AL test logic or production app code changes.

@github-actions github-actions Bot added Build: Automation Workflows and other setup in .github folder Build: scripts & configs Build scripts and configuration files Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction Team: Other GitHub request for other area than SCM, Finance or Integration labels Nov 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Removing the only direct regression test for Get-DisabledTestsForApp leaves exclusion JSON loading and combining uncovered because the routing test mocks the helper.

1 open issue
What changed in this PR

Reworks Business Central CI test execution into two app-level phases: regular tests and all retries first, followed by Disabled-isolation tests using the existing tenant queue. Legacy keeps its single pass.

Changes:

  • Removes upfront discovery, per-codeunit dispatch, database resets, and the obsolete clean-execution setting.
  • Separates phase retry bookkeeping and result files while sharing the job-wide rerun budget.
  • Updates tests for phase ordering, routing, retries, result merging, and completion caching.
File Description
build/​scripts/​tests/​ParallelTestExecution.Test.ps1 Replaces clean-tenant tests with app-level phase and result-handling coverage.
build/​scripts/​RunTestsInBcContainer.ps1 Updates a comment to describe the second app-level phase; no functional change.
build/​scripts/​ParallelTestExecution.psm1 Implements phased app dispatch and phase-specific results; removes discovery and database-reset helpers.
.github/​AL-Go-Settings.json Removes enableCleanTestCodeunitExecution.

Review effort: Max

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test replacement removes focused regression coverage for merging exclusion JSON files and temporary-directory fallback, so both helper tests need to be restored.

1 open issue
1 resolved since last review

Review effort: Max

@github-actions github-actions Bot added this to the Version 30.0 milestone Nov 6, 2026

This branch was previously deployed

1 inactive (outdated) deployment
triage — 6d6b7069 Deployed Nov 6, 2026 by aholstrup1 via Classify team ownership #10321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build: Automation Workflows and other setup in .github folder Build: scripts & configs Build scripts and configuration files Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction Team: Other GitHub request for other area than SCM, Finance or Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants