[API tests] Ensure vendor-payment journal number series - #11228
Prangshuman Das (t-prda) wants to merge 41 commits into
Conversation
Split from the preserved PR10085 snapshot. AB#646383 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve published branch history and re-enable only the 2 methods covered by this layer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
|
Issue #11561 is not valid. Please make sure you link an issue that exists, is open and is approved. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Good Sense Reviewer - Round 1Recommendation: AcceptWhat this PR doesThis change gives a test-created vendor-payment journal batch a generated number series when its template leaves that value blank. The guard addresses the failure at its source, preserves an existing configured series, and lets API tests generate document numbers as expected. Problem-solution fitFit: Strong The change directly covers the reported vendor-payment failures, and both re-enabled scenarios exercise the updated shared helper. SuggestionsNone. Risk assessment and necessityRisk: Low. The change is limited to test infrastructure. It affects the vendor-payment tests that use this helper, but only fills a blank number series and leaves existing configuration unchanged. Necessity: The change is needed to run the two previously disabled scenarios in environments where the vendor-payment template has no number series.
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
…exclusion Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Good Sense Reviewer - Round 2Recommendation: AcceptWhat this PR doesThe commits since round 1 reconcile the stacked parent only. The layer-owned AL code is unchanged, and the net diff still assigns a generated number series only when the test-created vendor-payment batch lacks one, then re-enables the same two scenarios. Status of previous suggestionsRound 1 had no suggestions. New observations (commits since round 1)None — no new layer-owned hunk appears in both the incremental view and the current net PR diff. Risk assessment and necessityRisk: Low. The change remains test-only, preserves configured number series, and changes shared-helper behavior only when the generated batch has no series. Fresh exact-head runtime validation is pending. Necessity: The change remains necessary to run the two vendor-payment scenarios where the template provides no number series.
|
| begin | ||
| JournalName := LibraryUtility.GenerateRandomCode(GenJournalBatch.FieldNo(Name), DATABASE::"Gen. Journal Batch"); | ||
| LibraryAPIGeneralJournal.EnsureGenJnlBatchExists(GraphMgtJournal.GetDefaultVendorPaymentsTemplateName(), JournalName); | ||
| GenJournalBatch.Get(GraphMgtJournal.GetDefaultVendorPaymentsTemplateName(), JournalName); |
There was a problem hiding this comment.
CreateVendorPaymentsJournal calls EnsureGenJnlBatchExists, which already performs a primary-key Get for this template and batch, and then immediately performs the same Get again before checking No. Series. This adds an avoidable database round trip on every helper call; return or pass through the record loaded by the ensure helper, or otherwise combine the existence check and No. Series update into one lookup.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.48.6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
…I test fixes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3952f078-a881-4da8-ad96-13b727e48a91
Scope
Assign a generated number series only when the test-created vendor-payment journal batch lacks one. Keep production numbering behavior unchanged.
AB#646383 — follow-up split from PR #10085; link only, not an instruction to resolve the umbrella work item.
Evidence and limits
Two observed CZ failures in saved result set 2: CU139843.TestCreateVendorPaymentWithoutDocNo and CU139867.TestApplyVendorEntryAppliesPayment. There are 18 direct test callers of the shared helper, but only these two failures are evidenced by those saved results.
Native GitHub stack #11893
This draft is stacked above #11227. #10085 is the bottom API-authentication fix. The review diff contains only this layer's fix plus removal of its 2 temporary method exclusions. Earlier layers are inherited, not repeated in this diff.
Existing PR/branch history is preserved; no force-push or merge into main was performed. NAV selection/company/native exclusions and existing out-of-scope Expense exclusions remain untouched.
Methods re-enabled by this layer
139843.TestCreateVendorPaymentWithoutDocNo139867.TestApplyVendorEntryAppliesPaymentValidation
Exact parent ancestry, file scope, whitespace and exclusion ownership checks pass. This layer's added/removed source lines are unchanged relative to its refreshed parent. Upstream changes are inherited through the main merge, not reverted. Earlier exact-head cumulative artifact evidence is historical after this parent reconciliation; fresh new-head runtime validation is pending. Existing excluded PDF, IN/RU gaps and tolerated-native distinctions remain; no absent/excluded case is claimed passing.
Historical targeted country evidence
Historical before this parent reconciliation; not new-head proof.
Final full-stack artifacts at
da6d82d6c8cf7c64bbd7355ca0acab28f0d5e28averify CZ: 2/2 owned methods passed exactly once. Each listed method passed exactly once in its country artifact from run36162564729. These are targeted country checks, not a claim about excluded PDF/native cases or Windows authentication.Validation limits
The previous UserPassword HTTP 401/200/401 result is historical after this reconciliation. CU139496
MicrosoftAuthenticationRespectsServerAuthModestill executes all three requests; Windows200/200/200 runtime remains unverified. The workflow clean-codeunit gate stays default-off and uptake stays explicitly enabled. No provider, authentication contract, new public event, NAV selector or foreign NST change was introduced. Excluded PDF cases and absent/excluded country/native cases remain unverified; prior tolerated-native results are not universal passes. The 59 owned re-enabled methods cover the reviewed fixes, not59 distinct product defects. Validation drafts remain Do Not Merge, outside native stack #11893.Current checkpoint
Head
43d49532985f295124457991410ca72345592232, tree0133d29f172a77b982a358260ca79000efef9b82; parent19d9186d1531b3856702491e36ef23b5e47f762b.Forward-integrated only captured main
eaddd6b3c518414f372154ea6cedd6c12b287359to resolve the actual uptake/full SyncMirror conflict. Upstream independently added three response clears and a ninth activity-log test,TravelRequestSubmissionExposesTotalExpectedAmounts, plus travel-request scope behavior. The reconciliation keeps all upstream additions and assertions, the original eight methods, all four independent policy-response clears, five query-safe URL compositions, configured auth provider, setup restoration and unlimited-approval fixture. All unrelated upstream changes and new exclusions remain; each layer retains its scoped changes. No moving-main refresh, warning suppression or retry-policy expansion.Local Pester:117 passed, zero failed/skipped at exact workflow, uptake and full heads. Deterministic blob/patch inventories verify captured-main propagation and semantic conflict resolution. The23 committed wrappers/shared success-only finalizer, absent generator, current-process credential identity, ACLs, buffer zeroing and narrowed classifier remain unchanged. Tenant-info help correctly documents Id/DatabaseName objects; executable workflow behavior is unchanged from the preceding checkpoint.
Fresh exact-head GitHub CI is pending, not passed. The activity-log codeunit now has9 methods: retain verification of the original176 cases (8x22), plus22 upstream-added cases, for198 if all22 Integration countries run. Old workflow successes and policy contamination evidence are historical, not fresh runtime proof. Seven correlated SQL-pool NREs occurred after tenant refreshes; lifecycle coupling remains possible, not infrastructure-only. The ES generated-sequence duplicate occurred during ordinary upstream SLS installation before discovery/reset; its precise race remains unproven. No blanket retries were issued.
Accepted cleanup limitation: success-only explicit cleanup; failed/cancelled runs rely on normal container teardown, with no hard-runner-loss guarantee. Per-run disposable CI credentials limit risk, not eliminate it; supplied credentials may differ. Hook invocation alone does not prove file deletion after teardown. CU139806
TestGetCompanyAndEnvironmentDescriptionsremains excluded pending original rationale/current NAV verification (PR11741). Permission cleanup from PR11561, native stack #11893, merged prefix and draft/ready states are preserved; validation drafts remain Do Not Merge. Windows runtime and excluded PDF/native coverage remain unverified.