Skip to content

Fix Report Inbox API E2E cross-company tests to create a second company - #10574

Open
Onat Buyukakkus (onbuyuka) wants to merge 2 commits into
mainfrom
bugs/647605-report-inbox-e2e-second-company
Open

Fix Report Inbox API E2E cross-company tests to create a second company#10574
Onat Buyukakkus (onbuyuka) wants to merge 2 commits into
mainfrom
bugs/647605-report-inbox-e2e-second-company

Conversation

@onbuyuka

@onbuyuka Onat Buyukakkus (onbuyuka) commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What & why

Fixes AB#647605

Codeunit 135549 "Report Inbox API E2E" helper OtherCompanyName() asserted that a second company exists. In the W1 web services test lane (RunALTests_W1_WebServices) the database contains only CRONUS International Ltd., so four cross-company scenarios failed during arrangement (0s, no Report Inbox API behavior exercised):

  • TestGetReportInboxItemsAcrossCompanies
  • TestGetReportInboxFileForEntryInAnotherCompanyIsNotWidenedSilently
  • TestGetReportInboxFileForEntryInAnotherCompanyWhenNamed
  • TestGetReportInboxContentDoesNotResolveAnotherCompany

Change

OtherCompanyName() now ensures a second company instead of asserting one:

  • returns an existing second company when present;
  • otherwise creates an empty company via Company.Insert(true) (new CreateSecondaryCompany() helper), mirroring the established pattern in CompanyConsolWizardTests.Codeunit.al. The name comes from LibraryUtility.GenerateGUID() (URL/OData-safe, e.g. GU00000001).

Validation

  • Built the Tests-Report project locally (symbols from a local BC server); the modified procedures produce no diagnostics.
  • These are web-service E2E tests that only run in the downstream NAV RunALTests_W1_WebServices lane, so full run validation happens there.

Follow-up (NAV repo)

The four tests are disabled on the NAV side in App/DisabledTests/ReportInboxAPIE2E.DisabledTest.json. Remove those entries to re-enable them once this fix flows into NAV via BCApps uptake. The BCApps Tests-Report.DisabledTest.json entries stay, since web-service E2E tests are not run in BCApps CI.

Codeunit 135549 "Report Inbox API E2E" helper OtherCompanyName() asserted
that a second company exists. In the W1 web services test lane the database
has only CRONUS International Ltd., so the four cross-company scenarios
failed during arrangement without exercising any Report Inbox API behavior.

Ensure a second company instead of asserting: return an existing one when
present, otherwise create an empty company via Company.Insert(true),
mirroring the pattern in CompanyConsolWizardTests. This lets the
cross-company tests seed into and address a real second company.

Fixes AB#647605

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0ddaff57-6fb9-4d00-b18a-051d18a22056
@onbuyuka
Onat Buyukakkus (onbuyuka) requested a review from a team August 24, 2026 19:21
@github-actions github-actions Bot added the Team: Integrations GitHub request for Integrations area label Aug 24, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 24, 2026
Removed comments about creating a secondary company for tests.
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

AI PR Review - Round 1

Recommendation: Accept

Risk assessment: Low. The test helper now ensures cross-company Report Inbox API scenarios have a second company to target instead of failing during arrangement when the test database contains only the current company.

Findings

No actionable correctness issues found.

[AI-PR-REVIEW] by=alexei-dobriansky round=1 head=71cf7e30aefc3f3de073338df73829cfd7267dab promptVersion=scm-review-gh-pr-v1 reviewKey=7ad77292e4878191 suggestions=none

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

Labels

Team: Integrations GitHub request for Integrations area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants