Skip to content

Repair and re-enable Expense Agent permission and posted-history tests - #11654

Draft
Prangshuman Das (t-prda) wants to merge 6 commits into
mainfrom
fix/expense-test-repairs-650245
Draft

Prangshuman Das (t-prda) wants to merge 6 commits into
mainfrom
fix/expense-test-repairs-650245

Conversation

@t-prda

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

Copy link
Copy Markdown
Contributor

What and why

Consolidate the Expense Agent test repairs on current main, following merged #11333.

  • Fix the three Expense Mgmt. Read/Edit/Admin tests by collecting all nine permission observations under the exact restricted role, restoring test permissions, and only then calling Assert. No production permissions change.
  • Replace the invalid ordinary positive/negative posted-history fixture with a normally posted zero-amount line. This preserves genuine posted header/line history and zero recorded spend for all eight deletion, report-recreation, and reapproval cases. Keep identity, ownership, audit, duplicate-report and zero-spend assertions.
  • Re-enable Approve/Submit/Reject Travel Request page-action tests. Their WebServiceActionResultCode assertion compilation fix is already on main.
  • Classify codeunit 148339 as UnitTest, as requested; it exercises AL in-process, including direct page procedures. The separate HTTP API codeunit remains IntegrationTest.
  • Repair the foreign-currency fixture in six AB#650247 API tests (the normal rate, not the adjustment rate, must be non-unit); refresh cross-session reads and verify persisted identities, dates and ownership without removing negative operations.
  • Remove exactly 14 role/history/action exclusions from the BCApps Expense Agent disabled-test manifest. No exclusions remain for codeunits 148338 or 148339 in this branch.
  • Preserve ALL HTTP API exclusions in BCApps, including the six AB#650247 cases: BCApps still needs the separate API-authentication prerequisite. The fixture corrections are retained, but these tests must not be counted as executed in BCApps. NAV has working API authentication and enables those six tests separately.

Related: AB#650245, AB#650277, AB#625894. NAV test-enablement/uptake also tracks AB#650246 and AB#650247.

This supersedes the overlapping repair work in drafts #11451 and #11452. Their other already-upstream changes are not replayed. The older drafts remain open until their owners reconcile/close them after this work is merged.

Validation

  • Static JSON/exclusion checks and git diff --check passed; read-only review found no significant issue.
  • Latest BCApps main was fetched and verified included: 0c994435e3ee038dbaf66822f8a2791b1aa3f43a.
  • Expected complete BCApps Default suites on this source: 20 tests in codeunit 148338 and 74 in codeunit 148339, including all 14 re-enabled methods. HTTP API tests remain excluded in BCApps by explicit user decision; their runtime evidence must come from the manually queued NAV buddy build instead.
  • Local W1 tenant2-1 resolution initially timed out because MSSQLSERVER was stopped. After the user requested local repair, that stopped dependency was started and both relevant databases are ONLINE. Tenant2-1 remains Failed; its Base/System/Application/Expense/Test apps are uninstalled and Cleaned. Normal tenant synchronization reports the tenant is not mounted. Shared NST is still 29.0.54137.0, incompatible with a current full BaseApp30 build.
  • No local publication or tests have run. No running service was restarted, no tenant1-1 data/configuration was changed, and no version metadata, reset, or reprovisioning was performed. Further local repair awaits explicit approval for an isolated BC30 environment or a shared-environment upgrade.
  • API authentication uses the existing helper unchanged. Draft Fix API test authentication in BCApps #10085 contains a separate shared authentication-provider change; it is not silently imported here. Until that dependency lands, BCApps API exclusions remain identical to main. NAV buddy results must establish whether the historical request-disappearance symptom is resolved.
  • CI compile, publication, and actual per-method XML/log execution verification are pending. A green aggregate check alone is not sufficient: earlier CI could report success after a codeunit runtime-compilation failure.
  • Private NAV uptake draft: NAV #254455. It removes 21 NAV method exclusions, including the six API cases, and restores the Expense Agent Tests app to Get-AppsToInstall by removing the blanket runner filter introduced in f09e1491f2adacca7a851a12587966daf91d993d.
  • The user will queue its buddy build manually. NAV remains draft until BCApps merges, the pointer is updated to an actual main commit, and buddy logs prove app installation and per-method execution. Static runner selection is not runtime installation evidence.

Whole-app NAV test exclusion and installation/execution validation: AB#650370. The scoped bugs 650245, 650246, 650247, 650277 and 650370 are Active while verification is pending.

CI iteration: 79ef58 (superseded by RU fixture correction)

Actual W1 Default JUnit artifact 10646077590 from run35596801127 records 148338 20/20 passed and 148339 74/74 passed, zero errors/skips, including all14 re-enabled methods. DE Default JUnit also records20/20+74/74.

RU Default job106353051317 failed: 14833820/20passed, but all74 Spend Request tests failed during Initialize because PrepareNormalGenPostingSetup could not find a fully populated General Posting Setup in the UnitTest database. This is fixture initialization, not74 different product failures.

Commit0ed0d44f92 creates a complete posting setup using existing Library - ERM helpers before the country-specific setup. New-head validation is pending; the prior-head W1/DE passes are not a claim that this new commit has passed. No tests were disabled for this failure. Local and NAV buddy execution caveats above remain.

CI iteration: 0ed0d44 (superseded by CH VAT fixture correction)

Actual JUnit from run35616107333 attempt2 verifies W1 and RU each passed all20 permission tests and74 Spend Request tests, zero failures/errors/skips. W1 artifact10658609682; RU artifact10658544297. This confirms the RU posting-setup correction.

CH Default job106447478820 failed: permissions20/20passed; all74 Spend Request cases stopped in country VAT initialization because the selected Normal VAT template referenced a nonexistent Sales VAT Account. Artifact10659053532 and the job stack identify Library - ERM Country Data.CreateVATPostingSetup.

Commit bd80ea3 initializes the VAT template before country setup, creating replacement Sales/Purchase VAT accounts only when the referenced account is missing. Valid account references and all assertions remain unchanged; no test is disabled. Fresh validation of W1, RU and CH on this new head is pending. Older-head pass evidence is not a claim that the new head passed.

Consolidate role assertion and real posted-history fixture repairs on main; re-enable fourteen Expense Agent tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Team: Finance GitHub request for Finance area labels Sep 21, 2026
@github-actions github-actions Bot modified the milestone: Version 30.0 Sep 21, 2026
…ests

Re-enable six Travel Requests API cases with fresh cross-session persistence checks. Keep HTTP integration coverage separate from in-process Spend Request tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
Retain NAV API enablement separately and omit added feature tags as requested.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
RU UnitTest databases need a complete posting setup before Library - ERM Country Data updates its accounts. Reuse standard library creators without changing test coverage or production behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
…ests

Repair missing account references on the Normal VAT template used by country initialization. Preserve valid accounts and all test assertions; avoid inheriting dangling references from prior fixtures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
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 ExpenseManagement Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant