Skip to content

Stabilize partial sales shipment undo test#9672

Open
attilatoury wants to merge 1 commit into
mainfrom
private/attilatoury/fix-640085-test-stability-main
Open

Stabilize partial sales shipment undo test#9672
attilatoury wants to merge 1 commit into
mainfrom
private/attilatoury/fix-640085-test-stability-main

Conversation

@attilatoury

@attilatoury attilatoury commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Problem

UndoSalesShipmentLinePartialWithAsmItemLotAndItemtrackingSerial uses 100 serial-tracked units and a random shipment divisor. This adds unnecessary warehouse activity and can make the supposed partial shipment a full shipment.

Fix

Reduce the quantity to 10 and deterministically ship half. This keeps multiple serial numbers, guarantees a partial shipment, and removes accidental stress and randomness.

This ports the stabilization for ADO 640085 to BCApps main. Release ports are NAV PRs 251310 and 251313.

Validation

  • git diff --check passed.
  • No editor diagnostics in the changed AL file.
  • Full local compilation remains blocked by unavailable matching reference dependencies.

Risk

Low. Only test data is changed; product code is unaffected.

@attilatoury
attilatoury requested a review from a team July 22, 2026 15:06
@github-actions github-actions Bot added the SCM GitHub request for SCM area label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234'

begin
// Test PostiveAdjmt Quantity on Whse Entry after undo Sales Shipment Line with Partial Qty when Items are created with Lot and Serial specific.
Initialize();
Quantity := 100;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Testing}$

The partial-shipment divisor changes from LibraryRandom.RandInt(3) to a hardcoded 2, and Quantity changes from 100 to 10, removing randomized coverage from this test. A near-identical sibling test in the same codeunit (UndoSalesShipmentLinePartialWithAsmItemSerialAndItemtrackingSerial, Quantity := 100; ShipmentQuantity := Quantity / LibraryRandom.RandInt(3)) is left unchanged, so the same risk this edit avoids (a random divisor that can yield a non-integer partial quantity for a serial-tracked item) still exists elsewhere in the file. BCQuality guidance recommends using LibraryRandom.RandInt/RandDec to generate test values rather than hardcoding them; if the goal was to avoid a non-integer partial quantity, prefer a randomized-but-safe divisor (for example LibraryRandom.RandIntInRange over divisors known to divide evenly) instead of pinning both the quantity and the divisor to fixed literals, and apply the same fix to the sibling test if it has the same latent issue.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant