Skip to content

[Expense Agent tests] Fix action-result assertions for runtime compilation - #11340

Draft
Prangshuman Das (t-prda) wants to merge 2 commits into
mainfrom
prdas/646383-fix-action-result-assertions
Draft

[Expense Agent tests] Fix action-result assertions for runtime compilation#11340
Prangshuman Das (t-prda) wants to merge 2 commits into
mainfrom
prdas/646383-fix-action-result-assertions

Conversation

@t-prda

@t-prda Prangshuman Das (t-prda) commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

AB#646383

Fix runtime compilation of CU 148339 Spend Request Test. Three existing page-action tests pass the built-in WebServiceActionResultCode to Assert.AreEqual, which requires an unsupported Variant conversion in generated C#.

Compare Format(WebServiceActionResultCode::Updated) with Format(ActionContext.GetResultCode()) using Assert.AreEqual. Preserve the existing error message and all fixture, audit-field, and report assertions. Both sides are formatted in the same context; no localized text or numeric result value is hardcoded.

Affected tests:

  • ApproveTravelRequestPageAction
  • SubmitTravelRequestPageAction
  • RejectTravelRequestPageAction

Evidence and validation

W1 Default, Integration and Uncategorized in run 34472110108 fail with CS1503: WebServiceActionResultCode cannot convert to NavValue. Test discovery compiles this codeunit before category/isolation filtering.

The assertion code was introduced by #11007 and is unchanged in the tested main revision. This PR changes exactly three lines in one AL test file. Source-equivalence checks and git diff --check pass.

The compilation fix is runtime-verified. Standalone CI and auth-branch CI each passed all 46 build jobs. All three repaired tests passed in every available Integration artifact: 22 standalone countries and 21 auth countries, including W1.

Both overall workflows remain failed. Twelve other Expense tests fail on both branches (six permission tests and six deletion/date/filter tests), with additional infrastructure failures. Auth-only CZ/DK failures are being investigated in the harness. These failures are not suppressed or fixed in this three-line prerequisite. No local NST result is claimed.

The first attempt (a4ed3c3f18) used direct equality, which CI rejected with AL0175. Corrected head 86497ab769 instead uses Format's intrinsic conversion. Read-only compiler inspection traced the supported conversion before the successful compilation and target-method execution above. The unsupported equality is no longer present.

Relationship to API authentication work

This is a separately reviewable prerequisite for #10085, not an authentication or production-behavior change. The corrected head 86497ab769 is included in its head b05ed58024 to unblock validation; once this prerequisite is merged into main, these three lines no longer belong to that PR's diff.

No tests are disabled or enabled. No workflow filters, NAV selectors, authentication code, or native-stack ordering change. This draft targets main independently; it is not another business-fix layer in stack #11232.

Compare the built-in WebServiceActionResultCode directly and pass the Boolean to Assert.IsTrue instead of requiring an unsupported Variant conversion. Preserve the expected Updated value, diagnostics, fixtures and exclusions.

AB#646383

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Sep 10, 2026
Prangshuman Das (t-prda) added a commit that referenced this pull request Sep 10, 2026
Include the three-line assertion fix from PR #11340 so typed API-test discovery can compile CU 148339. Keep existing exclusions and authentication behavior unchanged.

AB#646383

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
@github-actions github-actions Bot added this to the Version 30.0 milestone Sep 10, 2026
@github-actions github-actions Bot added the Team: Finance GitHub request for Finance area label Sep 10, 2026
…insic

Direct equality of WebServiceActionResultCode is rejected by AL0175. Format emits the explicit ALCompiler.ToNavValue system-option conversion; compare both formatted values while retaining the expected Updated code and existing diagnostics.

AB#646383

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Prangshuman Das (t-prda) added a commit that referenced this pull request Sep 10, 2026
Use the corrected Format-based assertions from PR #11340. Retain all authentication, initialization, exclusion and stack scope decisions.

AB#646383

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant