Skip to content

Re-enable BCPT Setup Card tests: fix NoOfSqlCallsAreLogged SQL assertion (Bug 618568)#8823

Open
gggdttt wants to merge 1 commit into
mainfrom
private/wenjiefan/618568-reenable-bcpt-setup-card-tests
Open

Re-enable BCPT Setup Card tests: fix NoOfSqlCallsAreLogged SQL assertion (Bug 618568)#8823
gggdttt wants to merge 1 commit into
mainfrom
private/wenjiefan/618568-reenable-bcpt-setup-card-tests

Conversation

@gggdttt

@gggdttt gggdttt commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Problem

Bug AB#618568. The test NoOfSqlCallsAreLogged in codeunit 144741 "BCPT Setup Card Test" was disabled during the platform 28.0.44646 uptake (PR 237052) because it started failing:

AssertEquals for Field: NoOfSQLStmts Expected = '5', Actual = '7'

Root cause

The test runs 5 iterations of BCPT Codeunit With 1 Sql (1 SQL statement each) and asserted NoOfSQLStmts = 5. However, the very first database access in a session also counts 2 extra SQL statements from system tables, making the total either 5 (iterations) or 7 (iterations + 2). This is the same non-determinism already documented in the sibling test LogsAreGeneratedAfterTheExecution, which accepts [0, 2] for a single entry.

AvgSQLStmts is computed via integer division (GetAvgSQLStmts = No. of SQL Statements div No. of Iterations), so 7 div 5 = 1 and 5 div 5 = 1 — the average assertion is unaffected.

Solution

Updated the assertion to accept the total being either the actual number of iterations or that number + 2, deriving the expectation from the measured iteration count rather than a hard-coded 5.

Changes

  • src/Tools/Performance Toolkit/Test/src/BCPTSetupCardTest.Codeunit.al: tolerant NoOfSQLStmts assertion in NoOfSqlCallsAreLogged.

Testing

  • AL static analysis: no diagnostics.
  • Full validation pending CI (RunALTestDevTools) once the test is re-enabled (the corresponding NAV-side change removes the DisabledTests entry).

Related

  • Re-enables tests disabled in PR 237052.
  • Paired with the NAV (ADO) change removing App/DisabledTests/BCPTSetupCardTest.DisabledTest.json.

… 618568)

The very first database access in a session counts 2 extra SQL statements from system tables, so the total NoOfSQLStmts is either the number of iterations or that number + 2. Updated the assertion to accept both, matching the existing pattern in LogsAreGeneratedAfterTheExecution.
@gggdttt gggdttt force-pushed the private/wenjiefan/618568-reenable-bcpt-setup-card-tests branch from 88e513d to 237b5ae Compare June 25, 2026 14:20
@gggdttt gggdttt changed the base branch from releases/28.2 to main June 25, 2026 14:20
@github-actions github-actions Bot added Build: Automation Workflows and other setup in .github folder Build: scripts & configs Build scripts and configuration files AL: Apps (W1) Add-on apps for W1 and removed AL: Tools labels Jun 25, 2026
@gggdttt gggdttt marked this pull request as ready for review June 25, 2026 14:53
@gggdttt gggdttt requested a review from a team June 25, 2026 14:53
@github-actions github-actions Bot added this to the Version 29.0 milestone Jun 25, 2026
@gggdttt gggdttt enabled auto-merge (squash) June 25, 2026 14:54
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 2 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

@gggdttt gggdttt closed this Jun 29, 2026
auto-merge was automatically disabled June 29, 2026 22:02

Pull request was closed

@gggdttt gggdttt reopened this Jun 29, 2026
@github-actions github-actions Bot added AL: Tools and removed Build: Automation Workflows and other setup in .github folder Build: scripts & configs Build scripts and configuration files AL: Apps (W1) Add-on apps for W1 labels Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant