Repository navigation
[Expense tests] Re-enable Expense Agent API tests - #12675
Prangshuman Das (t-prda) wants to merge 1 commit into
Conversation
8a5a5ad to
6dd7533
Compare
|
The newly enabled negative API test uses asserterror without checking the resulting error message or code, so an unrelated failure can make the test pass without proving that the unlinked Expense User is hidden. Add an assertion for the expected 404 response error. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.50.6 |
Good Sense Reviewer - Round 1Recommendation: Accept with SuggestionsWhat this PR doesThis change re-enables Expense API coverage under the default web service key authentication, removes the test-only authentication subscriber, and enables clean execution for disabled-isolation test codeunits. It also restores targeted Expense fixes, including exact approver filtering, permission checks, and spend-request total coverage. The authentication removal is consistent with the base provider. The approver-filter change avoids compressed ranges and quotes filter operators correctly, with focused coverage for wildcard, pipe, and range-gap user numbers. The temporary API exclusions are removed by the following stack layers. Problem-solution fitFit: Strong The change directly restores the blocked API suites after the shared authentication and runtime prerequisites became available. The code and tests match the reported clean-tenant and approval-filter scenarios. SuggestionsS1 (🟠 Moderate): Negative API test accepts unrelated failures Risk assessment and necessityRisk: Risk is concentrated in the repository-wide clean-codeunit setting and the new exact-value approver filter. The full CI matrix passes, the broad APIV1/APIV2 exclusions are explicitly temporary in the following stack, and the production filter change is covered for wildcard, pipe, and range-gap user numbers. No public API or event signature changes are introduced. Necessity: The change is needed to restore Expense API coverage and remove a credential-injection helper that is no longer required by the shared authentication provider. The scope is appropriate for the stacked rollout, but the re-enabled negative test should assert the exact 404 failure.
|
|
Valid point. This is pre-existing Expense Agent test code that this PR only re-enables, so it is tracked separately: AB#654047, fixed in follow-up #12773 (asserts |
Good Sense Reviewer - ReplyThanks for the details. Responses to your point:
|
6dd7533 to
9524556
Compare
|
The API test suite is being re-enabled while its manual authentication subscriber is deleted, but the new setting only changes test-codeunit execution cleanup and does not authenticate the outbound OData requests. Keep an authentication mechanism or provide an explicitly authenticated test endpoint before enabling these HTTP tests; otherwise the request can fail before the asserted API behavior runs. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.50.6 |
| // These HTTP tests remain excluded in Expense_Agent_Tests.DisabledTest.json until the | ||
| // authentication prerequisite provides an authenticated OData endpoint and a dedicated | ||
| // test company with committed fixtures and disabled test isolation. | ||
| // In-process employee filtering, traveler mapping/navigation, lifecycle, date, and scope coverage |
There was a problem hiding this comment.
The change deletes the only test-only Basic authentication subscriber and removes its BindSubscription calls while enabling the HTTP API scenarios. The LibraryGraphMgt requests therefore have no explicit authentication path on the OnPrem test target and can receive 401 responses instead of exercising the API. Restore an authenticated test handler or configure a dedicated authenticated test company before enabling these tests.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.50.6
9524556 to
71cca5b
Compare
|
The change enables UnlinkedExpenseUserIsHiddenFromAPI, but its negative request still uses bare asserterror without checking the expected 404 error. Any unrelated request failure, including authentication or setup failure, can therefore make the newly enabled test pass; assert the expected response error (and code where available) after the call. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.50.6 |
Remove the Expense API Test Auth Helper (no Key Vault secret, no subscriber) and apply the Expense app and test fixes. Keep only Expense disablements that NAV master also has. Enable clean test codeunit execution; APIV1/APIV2 tests that this surfaces are temporarily excluded (entries from #12325) and re-enabled by the following layers. AB#646383 AB#653393 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
71cca5b to
15f12fc
Compare
Review focus: the Expense test changes and the auth-helper deletion; the
enableCleanTestCodeunitExecutionline. The large JSON diffs are temporary disables, undone in C.Re-enables the Expense Agent API tests on top of the default web service key auth. No Key Vault password and no auth subscriber.
Expense API Test Auth Helperand its usages.TravelRequestApproval, Expense permission and spend-request tests, theExpDetailTestpermission set, andSpendRequestTests.enableCleanTestCodeunitExecution, as [Expense tests] Re-enable reviewed APIs and consolidate Expense fixes #12325 did, soRequiredTestIsolation = Disabledcodeunits run in clean-tenant lanes.Related: AB#646383, AB#653393
Stack (each PR shows only its own layer; merge bottom first)
main)Experiments (on D8, do not merge): #12685 E single tenant, #12686 F no clean execution. Combined validation (do not merge): #12687, same tree as D8.
Platform:
mainalready pins BCPlatform 30.0.56112.0, which includes the SQL connection-pool fix (AB#653457).Note for CI: AL-Go's new-warning check needs a CI/CD baseline from the base branch, and
features/*bases have none, so a PR build there fails with a 404. The current CI runs were triggered while these PRs targetedmain, so their results are valid for the cumulative change.