Skip to content

Standard/Evaluation DemoTool smoke test in Legacy CI#9178

Merged
aholstrup1 merged 8 commits into
mainfrom
aholstrup1-fix-nl-currency-demo-account
Jul 10, 2026
Merged

Standard/Evaluation DemoTool smoke test in Legacy CI#9178
aholstrup1 merged 8 commits into
mainfrom
aholstrup1-fix-nl-currency-demo-account

Conversation

@aholstrup1

@aholstrup1 aholstrup1 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What & why

BCApps legacy tests only ever generate Extended demo data. The Standard/Evaluation generation path (Interface Trial Data.CreateSetupData, CU122000, selected in Create Demonstration Data CU101900) is never exercised in BCApps CI. Only NAV's BuildTranslatedCountryDatabase.ps1 loops Standard/Evaluation/Extended when building shippable packages. As a result, a class of DemoTool runtime bugs escapes BCApps and only fails later in the NAV repo (which consumes BCApps as a submodule).

Concrete example: sync PR #8928 accidentally deleted src/Layers/NL/DemoTool/CreateCurrency.Codeunit.al. BCApps stayed green; the NAV Standard build then failed with "The field Realized Exchange Gains Account of table Currency contains a value (9620) not found in G/L Account". Fixed by re-adding the override in #9135, but the coverage gap remained.

This adds an opt-in smoke test that runs the legacy DemoTool for the requested non-Extended data types against throwaway companies, gated by a new smokeTestDemoDataTypes AL-Go setting. It runs in the Legacy branch of Invoke-DemoDataGeneration, before New-TestCompany rebuilds the real Extended test company from a clean slate, so it cannot affect the demo data the tests actually run against. The plumbing was mostly already there: Initialize-DemoToolResources already accepts -DemoDataType and writes it into the staged config.

Enabled on Test Apps NL (Standard + Evaluation) as the proving ground, so between the smoke test and the real Extended run, all three data types get exercised for NL.

Warning

Draft / not for merge as-is. The second commit deliberately reverts the #9135 fix (deletes CreateCurrency.Codeunit.al) to reintroduce the 9620 bug and prove the smoke test catches it in CI. That revert must be dropped before this could merge.

Linked work

N/A (prototype / validation experiment). Related: AB#641606 (CI check work item), AB#641861 (tracks the CZ/DK demo-data failures that are excluded here)

Fixes #

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

  • PowerShell parses cleanly ([System.Management.Automation.Language.Parser]::ParseFile -> no syntax errors); NL settings.json validated as JSON.
  • Full container/CI validation is exactly what this draft is for: with the reintroduced bug (commit 2), the NL Legacy Bucket1 job's new Standard/Evaluation smoke test is expected to fail with the account-9620 error, demonstrating it catches what Extended-only CI missed. With the fix intact it should pass.
  • No AL test objects added; this is CI-tooling only.

Risk & compatibility

  • Fully opt-in: when smokeTestDemoDataTypes is unset/empty, behavior is unchanged. Only enabled on Test Apps NL here.
  • Isolation: the smoke test uses disposable companies created and removed before New-TestCompany, which then wipes all companies and rebuilds the real one, so the real Extended test data is provably untouched.
  • CI cost: one extra demo-data generation per participating Legacy job (Legacy jobs are the slowest). Scoped to Bucket1 only, and to localizations if rolled out further.
  • Unknowns: first-run shakeout of Standard/Evaluation generation inside a container (rapidstart export to user folders, language packs, tenant-ready timing).
  • Contains a deliberate revert of re-added createcurrency for NL #9135 for validation; must be removed before merge.

BCApps legacy tests only generate Extended demo data, so the Standard/Evaluation generation path (Interface Trial Data.CreateSetupData, CU122000) is never exercised. Bugs there only surface later in the NAV translated-country build.

Add an opt-in smoke test (gated by the smokeTestDemoDataTypes AL-Go setting) that runs the legacy DemoTool for the requested non-Extended data types against throwaway companies, before the real Extended test company is built, so it cannot affect the demo data tests run against. Enabled on Test Apps NL (Standard + Evaluation) as the proving ground.
@github-actions github-actions Bot added the Build: scripts & configs Build scripts and configuration files label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Issue #9135 is not valid. Please make sure you link an issue that exists, is open and is approved.

…cket1

Rename the concept from smokeTest to additionalDemoDataTypes (setting key, function Invoke-AdditionalLegacyDemoData, throwaway company and log text).

Move enablement from the NL project to a global conditionalSettings entry in .github/AL-Go-Settings.json keyed on buildMode LegacyTestsBucket1, so the additional Standard/Evaluation demo data generation runs once per country (Bucket1 only) across all countries.
@github-actions github-actions Bot added the Build: Automation Workflows and other setup in .github folder label Jul 7, 2026
@aholstrup1 aholstrup1 marked this pull request as ready for review July 7, 2026 14:31
@aholstrup1 aholstrup1 requested review from a team July 7, 2026 14:31
Comment thread build/scripts/ImportTestDataInBcContainer.ps1
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 4 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

NAV's Run-NavDemoTool runs the legacy DemoTool against a fresh EMPTY company and never runs Company-Initialize (CU2). BCApps ran CU2 first, which for CZ/DK pre-seeds localization setup (via OnCompanyInitialize subscribers) that collides with the Standard/Evaluation demo data paths (duplicate CZL VAT Return Period; missing DK DOMESTIC VAT posting group).

Add a -SkipCompanyInitialize switch to Invoke-LegacyDemoDataTool, passed only by the additional (Standard/Evaluation) throwaway-company verification, so it mirrors NAV for all countries. The real Extended test company keeps CU2 (unchanged).
CZ Evaluation (duplicate CZL VAT Return Period) and DK Standard (missing DOMESTIC VAT Bus. Posting Group) fail the additional demo data check in a clean container. The same shared-submodule code runs green in NAV's translated-country build, so the cause is environmental/build-config, not the check itself; skipping Company-Initialize (CU2) did not change it.

Disable the check for CZ and DK only, via a project-level LegacyTestsBucket1 conditional setting. AL-Go merges (concatenates) array settings, so overwriteSettings is used to force additionalDemoDataTypes to an empty array for these two countries. All other countries still run Standard+Evaluation. Tracked for follow-up.
Wrap the finally-block cleanup (Get/Remove-CompanyInBcContainer) in its own try/catch that only logs. Under ErrorActionPreference=Stop a cleanup failure in finally would otherwise replace the diagnostic error propagating from the catch block, losing the DataType/country context this check exists to surface. Addresses PR review feedback.
@aholstrup1 aholstrup1 changed the title Prototype: Standard/Evaluation DemoTool smoke test in Legacy CI Standard/Evaluation DemoTool smoke test in Legacy CI Jul 9, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 9, 2026
@aholstrup1 aholstrup1 enabled auto-merge July 9, 2026 11:48
@aholstrup1 aholstrup1 added this pull request to the merge queue Jul 9, 2026
Merged via the queue into main with commit 0f1813f Jul 10, 2026
479 of 502 checks passed
@aholstrup1 aholstrup1 deleted the aholstrup1-fix-nl-currency-demo-account branch July 10, 2026 00:04
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants