Prototype: Standard/Evaluation DemoTool smoke test in Legacy CI#9178
Prototype: Standard/Evaluation DemoTool smoke test in Legacy CI#9178aholstrup1 wants to merge 5 commits into
Conversation
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.
This reverts commit 1d5d7be.
|
Issue #9135 is not valid. Please make sure you link an issue that exists, is open and is approved. |
This reverts commit 870f61c.
…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.
…rency-demo-account
| -Credential $Credential -Tenant $Tenant -DemoDataType $demoDataType | ||
|
|
||
| Write-Host "Legacy DemoTool additional demo data check for DataType=$demoDataType succeeded" | ||
| } catch { |
There was a problem hiding this comment.
In the new Invoke-AdditionalLegacyDemoData function, the catch block throws a carefully constructed diagnostic message (including DataType and country context) specifically to make this class of DemoTool failure easier to triage.
However, the finally block unconditionally attempts Remove-CompanyInBcContainer for the throwaway company. In PowerShell (as in .NET generally), an exception raised inside a finally block replaces/masks any exception already propagating from the try/catch above it. Because the scenario this function is built to catch is exactly a failure during demo-data generation into that company, the company/container state is plausibly left in a condition where the cleanup Remove-CompanyInBcContainer call itself fails or times out -- and if it does, the informative error this function exists to produce is silently discarded, replaced by an unrelated cleanup-failure message.
Recommendation:
- capture the original error in the catch block, wrap the cleanup call in its own try/catch that only logs (does not throw) on cleanup failure, and re-throw the original diagnostic error afterward so cleanup problems never suppress the primary failure.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
Copilot PR ReviewIteration 1 · Outcome: completed
Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 0 knowledge-backed · 1 agent findings. Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
What & why
BCApps legacy tests only ever generate
Extendeddemo data. TheStandard/Evaluationgeneration path (Interface Trial Data.CreateSetupData, CU122000, selected inCreate Demonstration DataCU101900) is never exercised in BCApps CI. Only NAV'sBuildTranslatedCountryDatabase.ps1loops 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
smokeTestDemoDataTypesAL-Go setting. It runs in theLegacybranch ofInvoke-DemoDataGeneration, beforeNew-TestCompanyrebuilds 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-DemoToolResourcesalready accepts-DemoDataTypeand 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, root-cause fix #9135 / AB#641121.
Fixes #
How I validated this
What I tested and the outcome
[System.Management.Automation.Language.Parser]::ParseFile-> no syntax errors); NLsettings.jsonvalidated as JSON.Risk & compatibility
smokeTestDemoDataTypesis unset/empty, behavior is unchanged. Only enabled onTest Apps NLhere.New-TestCompany, which then wipes all companies and rebuilds the real one, so the real Extended test data is provably untouched.