Skip to content

[202605][conditional_mark] Backport nodeid normalization for centralized marks#26452

Closed
Xichen96 wants to merge 1 commit into
sonic-net:202605from
Xichen96:dev/xichenlin/backport-nodeid-normalization-202605
Closed

[202605][conditional_mark] Backport nodeid normalization for centralized marks#26452
Xichen96 wants to merge 1 commit into
sonic-net:202605from
Xichen96:dev/xichenlin/backport-nodeid-normalization-202605

Conversation

@Xichen96

@Xichen96 Xichen96 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description of PR

Summary:
Backport #25930 to 202605 so centralized conditional marks still match when pytest resolves rootdir above the tests/ directory. This is a prerequisite for the warm-reboot conditional skips in #26417 to apply under the standard run_tests.sh invocation.

Related to #25929, #25930, and #26417.

ADO: https://msazure.visualstudio.com/One/_workitems/edit/38862000

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605

Tested branch

  • master
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • N/A

Test result

  • 202605: testbed-bjw-can-720dt-3 (m0, Arista-720DT-G48S4) on SONiC.20260510.06; with this normalization fix and the [route]: Skip warm reboot tests on m0/m1/mx #26340 warm-reboot marks, targeted tests/run_tests.sh completed with 3 skipped, 0 failures, exit 0 in 43.88 seconds. Each case reported Warm reboot is not supported on dualtor, m0, m1, or mx topologies.
  • CI: all checks passed at head 8724ffec97851a6359cef16d64b94ebc8a106e32, including every impacted Elastictest lane.

Approach

What is the motivation for this PR?

The 202605 branch only strips basename(rootpath) from collected node IDs. Standard run_tests.sh arguments can make pytest resolve rootdir at the repository root, leaving node IDs prefixed with tests/. Conditional-mark keys are relative to tests/, so every centralized skip or xfail silently misses in that mode.

#26417 adds topology-based warm-reboot skips through the centralized conditional-mark file and therefore requires this normalization fix.

How did you do it?

Cherry-picked the functional change from #25930. After the existing root-directory normalization, the plugin now also strips a leading tests/ before matching the node ID against conditional-mark keys.

How did you verify/test it?

py_compile and git diff --check passed on the 202605 backport branch. The backported patch matches #25930 apart from expected context offsets.

Physical validation on testbed-bjw-can-720dt-3 used SONiC.20260510.06 with this normalization fix and the #26340 warm-reboot marks. The standard test runner selected all three target cases as skips with zero failures.

Any platform specific information?

No. The fix applies to every platform when pytest reports node IDs with a leading tests/.

Supported testbed topology if it's a new test case?

Not a new test case.

Documentation

Not applicable.

Backport sonic-net#25930 so conditional marks match tests/-relative keys when
pytest resolves rootdir above the tests directory.

This is required for the warm-reboot skips in sonic-net#26417 to apply under the
standard run_tests.sh invocation.

(cherry picked from commit 3cf07f4)

Signed-off-by: Nikhil Hegde <nikhilhegde@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b8fb8259-87f3-4de3-b1a4-59fe52e8be86
Signed-off-by: Xichen96 <lukelin0907@gmail.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request for branch(es): 202605.
Added label(s) for branch(es) 202605.

---Powered by SONiC BuildBot

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request label(s) for branch(es): 202605, but is missing required test information. Please make sure you tick the tested branch(es) in the Tested branch section and provide test evidence (e.g., 202605: <test result>) in the Test result section as well in your PR description.

---Powered by SONiC BuildBot

@Xichen96

Copy link
Copy Markdown
Contributor Author

Superseded by the label-driven 202605 backport automation from the original PR: #25930. Automated backport: #26518.

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request for branch(es): 202605.
Added label(s) for branch(es) 202605.

---Powered by SONiC BuildBot

@mssonicbld mssonicbld added the Tested for 202605 branch Tested for 202605 branch label Jul 23, 2026
@mssonicbld

Copy link
Copy Markdown
Collaborator

The Tested branch section has been ticked and Test result is provided for branch(es): 202605. Added label(s): Tested for 202605 Branch.

---Powered by SONiC BuildBot

@Xichen96
Xichen96 deleted the dev/xichenlin/backport-nodeid-normalization-202605 branch July 23, 2026 17:15
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.

3 participants