Make test company deletion best-effort in ImportTestDataInBcContainer#9436
Draft
aholstrup1 wants to merge 4 commits into
Draft
Make test company deletion best-effort in ImportTestDataInBcContainer#9436aholstrup1 wants to merge 4 commits into
aholstrup1 wants to merge 4 commits into
Conversation
…/github.com/microsoft/BCApps into aholstrup1-fictional-train
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The DK unit/integration/legacy test jobs started failing at demo-data setup after the platform artifact bump (
29.0.51074.0->29.0.52563.0).New-TestCompanydeletes existing companies before creating the fresh test company, and deleting DK's artifact companyCRONUS Danmark A/Snow throws:The root cause is a platform regression (tracked as AB#642236): the rewritten
Remove-NAVCompanyroutes the delete through the V3 REST management API and URL-encodes the company name into the request path, so the/becomes%2Fand the server never resolves it. Only company names containing/are affected, which is why DK is the only country that fails.This change makes the pre-delete step best-effort: each
Remove-CompanyInBcContainercall is wrapped in try/catch and a failed removal emits a::warning::instead of aborting the whole job. Tests still run in the freshly created company named from settings (e.g.CRONUS International Ltd.for DK Legacy), which never collides with the leftover artifact company, so skipping a delete does not affect test targeting. The trade-off is that an undeletable evaluation company may linger in the container.This is a BCApps-side mitigation to unblock CI; the underlying platform bug still needs its own fix.
Linked work
Fixes #
AB#642236
How I validated this
What I tested and the outcome
Change is limited to the CI test-data setup script (
build/scripts/ImportTestDataInBcContainer.ps1). Verified from the failing run logs that the delete ofCRONUS Danmark A/Sis the sole cause of the DK job failures and occurs before any test runs; the try/catch lets setup proceed to company creation. No automated test is added because this is build-tooling error handling, not product behavior.Risk & compatibility
Low. Deletion is now non-fatal, so a genuine failure to remove a company will be surfaced as a warning rather than a hard failure. If cleanup is skipped, an extra (evaluation) company may remain in the container, but tests target the freshly created company by name and are unaffected. Once the platform regression (AB#642236) is fixed, deletion succeeds again and the catch is simply not exercised.