Repository navigation
[API tests] Set sales quote document and posting dates in API tests - #12680
Prangshuman Das (t-prda) wants to merge 1 commit into
Conversation
fe76e3a to
89f5e34
Compare
Good Sense Reviewer - Round 1Recommendation: AcceptWhat this PR doesThis change sets the sales quote Posting Date and Document Date to WorkDate in the shared APIV1 and APIV2 test fixtures, then removes the exclusions for the quote-to-order tests. The Posting Date validation may synchronize the Document Date when that setup is enabled; the following explicit Document Date validation leaves both fields equal, and Modify(true) persists the values before the API call. The helper also creates quotes for the get, delete, send, and invoice scenarios. Giving all of those fixtures the same valid dates is consistent across both API versions and does not change production code or a public surface. Problem-solution fitFit: Strong The failing quote conversion can have a Document Date later than its Posting Date under some date setups. Setting both dates to WorkDate directly removes that mismatch, and the exact APIV1 and APIV2 tests are no longer excluded. SuggestionsNone. Risk assessment and necessityRisk: The change is limited to test data, but the shared fixture is used by several sales quote scenarios. All affected tests now use normalized dates; no production logic, event publisher, or public API is changed. Necessity: The change is needed to make quote conversion deterministic across date and localization setups and to restore coverage for both API versions. The implementation is small and mirrored between APIV1 and APIV2.
|
89f5e34 to
1fd42b2
Compare
1fd42b2 to
d218888
Compare
d218888 to
e1c5c34
Compare
e1c5c34 to
faf8f31
Compare
Good Sense Reviewer - Round 2Recommendation: AcceptWhat this PR doesThis change sets deterministic, license-safe posting and document dates for sales quotes in the APIV1 and APIV2 tests, then re-enables both quote-to-order tests. Every caller initializes the safe work date, and the matching changes keep both API versions aligned. Status of previous suggestionsNo suggestions were raised in round 1. New observations (commits since round 1)None. The full current diff was reviewed because the earlier commit is no longer reachable after the rebase. Risk assessment and necessityRisk: Low. The change only adjusts test setup and disabled-test manifests. It does not change production behavior. Necessity: The date setup is required to run the quote-to-order tests reliably with the license-safe work date and restore their coverage.
|
faf8f31 to
5876aaa
Compare
Align quote dates with the work date before converting to an order and re-enable the make-order tests. AB#646383 AB#653393 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
5876aaa to
8b174d1
Compare
Good Sense Reviewer - Round 3Recommendation: AcceptWhat this PR doesThis change sets the posting date and document date to the license-safe work date in the shared APIV1 and APIV2 sales quote fixtures, then re-enables the quote-to-order tests. Validating the posting date first and the document date second leaves both fields aligned before Modify(true) persists the quote, which directly removes the date mismatch during conversion. Status of previous suggestionsNo suggestions were raised in round 2. New observations (commits since round 2)None. The full current diff was reviewed because the previous reviewed commit is no longer reachable after the rebase. Risk assessment and necessityRisk: Low. The shared fixture also supplies quotes to get, delete, send, and invoice tests, so those tests now receive normalized dates too. The change remains test-only, is mirrored across both API versions, and does not alter production behavior or a public surface. Necessity: Aligning both dates makes quote conversion deterministic across date and localization setups and restores the two excluded quote-to-order tests. The scope is limited to the affected fixtures and exclusion entries.
|
Review focus: ``MicrosoftTestAuthProvider`` (about 60 lines) and the enum default; the ``build/`` changes are deletions plus the anti-SSRF line in ``NewBcContainer.ps1``. Defaults API test authentication (`Library - Graph Mgt`) to the current user's web service key. API tests no longer need per-app auth uptake or a container password. - `API Test Authentication` enum: `DefaultImplementation` = `Microsoft Test Auth Provider`. Removes `No API Test Auth Provider` and the explicit `Microsoft Test Environment` value. - `Microsoft Test Auth Provider`: on-premises with NavUserPassword, sends Basic auth with `UserId()` and the web service key. When the key is missing or expired, a background session (`API Test Web Service Key`, CU 131025) creates it with a 24h expiry and commits it, because the API request runs in a separate server session. The caller's transaction is never committed; the provider waits up to 60 s for the session and then re-reads the key. - `Library - Graph Mgt`: adds the `SetLicenseSafeWorkDate` and `AddFieldToIgnoreIfExists` helpers used by later layers. - Build: removes the container password and Key Vault credential plumbing (`ApiTestCredential.psm1`, `Remove-ApiTestPassword.ps1`, `PipelineFinalize` hooks and their tests). Keeps the clean-tenant execution logic. Sets `NavHttpClientAntiSSRFEnabled=false` in the test container, as NAV `RunALTests.ps1` does: since microsoft#12323, API tests call the container's own endpoint through AL `HttpClient`, which anti-SSRF blocks. - CU 139494 `API Test Auth Provider Tests`: covers key creation and renewal. Declares `TestHttpRequestPolicy = AllowAllOutboundRequests` (NAV blocks outbound requests by default; microsoft#12694 covered the other API tests). Related: [AB#646383](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/646383), [AB#653393](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/653393) ### Stack (each PR shows only its own layer; merge bottom first) 1. microsoft#12674 A: web service key auth (base: `main`) 2. microsoft#12675 B: Expense API tests + clean test codeunit execution 3. microsoft#12676 C: re-enable APIV1/APIV2 API tests 4. microsoft#12890 Review fixes for A: simplify web service key handling 5. Area fixes: microsoft#12677 D1 VAT fixtures → microsoft#12678 D2 cancellation reasons → microsoft#12679 D3 localized discounts → microsoft#12680 D4 quote dates → microsoft#12681 D5 journal numbering → microsoft#12682 D6 field comparison → microsoft#12683 D7 PDF documents → microsoft#12684 D8 APIV1 reliability Experiments (on D8, do not merge): microsoft#12685 E single tenant, microsoft#12686 F no clean execution. Combined validation (do not merge): microsoft#12687, same tree as D8. Platform: `main` already pins BCPlatform 30.0.56112.0, which includes the SQL connection-pool fix ([AB#653457](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/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 targeted `main`, so their results are valid for the cumulative change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Review focus: the Expense test changes and the auth-helper deletion; the ``enableCleanTestCodeunitExecution`` line. 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. - Deletes `Expense API Test Auth Helper` and its usages. - Re-applies the Expense fixes from microsoft#12325 (reverted in microsoft#12514): `TravelRequestApproval`, Expense permission and spend-request tests, the `ExpDetailTest` permission set, and `SpendRequestTests`. - Turns on `enableCleanTestCodeunitExecution`, as microsoft#12325 did, so `RequiredTestIsolation = Disabled` codeunits run in clean-tenant lanes. - Expense disabled tests: keeps only the entries NAV master also disables (12). - Temporarily disables the unrelated APIV1/APIV2 tests that the clean lanes start executing, the same entries microsoft#12325 added. They are re-enabled in the next layers. Related: [AB#646383](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/646383), [AB#653393](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/653393) ### Stack (each PR shows only its own layer; merge bottom first) 1. microsoft#12674 A: web service key auth (base: `main`) 2. microsoft#12675 B: Expense API tests + clean test codeunit execution 3. microsoft#12676 C: re-enable APIV1/APIV2 API tests 4. microsoft#12890 Review fixes for A: simplify web service key handling 5. Area fixes: microsoft#12677 D1 VAT fixtures → microsoft#12678 D2 cancellation reasons → microsoft#12679 D3 localized discounts → microsoft#12680 D4 quote dates → microsoft#12681 D5 journal numbering → microsoft#12682 D6 field comparison → microsoft#12683 D7 PDF documents → microsoft#12684 D8 APIV1 reliability Experiments (on D8, do not merge): microsoft#12685 E single tenant, microsoft#12686 F no clean execution. Combined validation (do not merge): microsoft#12687, same tree as D8. Platform: `main` already pins BCPlatform 30.0.56112.0, which includes the SQL connection-pool fix ([AB#653457](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/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 targeted `main`, so their results are valid for the cumulative change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Review focus: mostly mechanical. ``Initialize`` sets a license-safe work date in each API test, and the JSON deletions re-enable tests. A few files have small fixture or isolation tweaks. Re-enables the APIV1, APIV2, IRS 1099 and E-Document API tests that pass without area-specific fixes. Aligned with NAV master: only tests that NAV master also runs are re-enabled. - API test `Initialize` sets a license-safe work date. Adds minimal fixture and isolation adjustments. - Removes the APIV1/APIV2 exclusions, keeping only the entries fixed in the following area PRs and the two `139806` methods NAV master disables. Removes E-Doc `135575`. Related: [AB#646383](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/646383), [AB#653393](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/653393) ### Stack (each PR shows only its own layer; merge bottom first) 1. microsoft#12674 A: web service key auth (base: `main`) 2. microsoft#12675 B: Expense API tests + clean test codeunit execution 3. microsoft#12676 C: re-enable APIV1/APIV2 API tests 4. microsoft#12890 Review fixes for A: simplify web service key handling 5. Area fixes: microsoft#12677 D1 VAT fixtures → microsoft#12678 D2 cancellation reasons → microsoft#12679 D3 localized discounts → microsoft#12680 D4 quote dates → microsoft#12681 D5 journal numbering → microsoft#12682 D6 field comparison → microsoft#12683 D7 PDF documents → microsoft#12684 D8 APIV1 reliability Experiments (on D8, do not merge): microsoft#12685 E single tenant, microsoft#12686 F no clean execution. Combined validation (do not merge): microsoft#12687, same tree as D8. Platform: `main` already pins BCPlatform 30.0.56112.0, which includes the SQL connection-pool fix ([AB#653457](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/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 targeted `main`, so their results are valid for the cumulative change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Review focus: date setup in two sales quote tests.
Area fix (previously #11227): aligns sales quote document and posting dates, then re-enables the affected tests.
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.