Skip to content

[conditional_mark] Skip decap/test_decap.py on Arista-720DT and remove stale parametrize-keyed entries#24626

Merged
Xichen96 merged 1 commit into
sonic-net:masterfrom
Xichen96:dev/xichenlin/cm-skip-decap-720dt-cleanup
May 15, 2026
Merged

[conditional_mark] Skip decap/test_decap.py on Arista-720DT and remove stale parametrize-keyed entries#24626
Xichen96 merged 1 commit into
sonic-net:masterfrom
Xichen96:dev/xichenlin/cm-skip-decap-720dt-cleanup

Conversation

@Xichen96
Copy link
Copy Markdown
Contributor

Description of PR

Two related changes to tests/common/plugins/conditional_mark/tests_mark_conditions.yaml for decap/test_decap.py:

  1. Add 'Arista-720DT' in hwsku to the top-level decap/test_decap.py: skip block.
  2. Remove eight stale parametrize-keyed entries that have been dead since PR [test-decap] Fix test decap for pipe mode #20304decap/test_decap.py::test_decap[ttl=*, dscp=*, vxlan=*]:.

Result: +3 / -63 lines, no behavioural changes for any platform other than Arista-720DT (which gets skipped).

Why (1) — skip on Arista-720DT

Arista-720DT (TD3-X2 / BCM56873) does not honor SAI_TUNNEL_DSCP_MODE_UNIFORM_MODEL. SONiC programs the entire stack correctly (CONFIG_DB → APPL_DB → ASIC_DB → sairedis.rec all show dscp_mode=uniform), but the chip clears the inner DSCP regardless of the configured mode. Arista has acknowledged this as a platform-level limitation and granted a concession in aristanetworks/sonic-qual.msft#1176.

Why (2) — remove stale entries

PR #20304 (2025-08-28) refactored tests/decap/conftest.py: it removed pytest_generate_tests + build_ttl_dscp_params and replaced them with the supported_ttl_dscp_params fixture, which returns a single {ttl, dscp, vxlan} dict per session based on the DUT's APP_DB / ASIC heuristics.

Since that refactor, pytest --collect-only decap/test_decap.py collects exactly one item: decap/test_decap.py::test_decap — no parametrize suffix. The eight [ttl=*, dscp=*, vxlan=*] entries in tests_mark_conditions.yaml have therefore been matching zero items for the last ~9 months. Removing them is a pure cleanup; git history preserves them.

The only rule that pytest's conditional_mark plugin can match against the single collected test_decap item is the top-level decap/test_decap.py: rule, which is why the new skip belongs there.

How to verify it

Empirically verified on testbed-bjw2-can-720dt-6 (m0, internal-202511 mgmt + SONiC.20251110.26):

Run yaml state pytest result
baseline unchanged 1 error in 8.56s (test_decap proceeds past conditional_mark and errors at duthosts fixture — nothing matched)
this PR top-level skip + stale entries removed 1 skipped, 9 warnings in 2.98stest_decap is marked SKIPPED before any fixture fires
skip-only sub-patch top-level skip only, stale entries still present same 1 skipped, 9 warnings in 2.98s — confirms removing the stale entries has zero behavioural effect

Related

Backports

Backports handled by automation after master merges.

…tale parametrize-keyed entries

Add `'Arista-720DT' in hwsku` to the top-level `decap/test_decap.py:` skip
block, and remove eight `decap/test_decap.py::test_decap[ttl=*, dscp=*,
vxlan=*]:` entries that have been dead since PR sonic-net#20304.

Why
---

1. Arista-720DT (TD3-X2 / BCM56873) does not honor
   `SAI_TUNNEL_DSCP_MODE_UNIFORM_MODEL`. SONiC programs CONFIG_DB, APPL_DB,
   ASIC_DB, and sairedis with `dscp_mode=uniform` correctly, but the chip
   clears the inner DSCP regardless of mode. Arista has acknowledged this
   as a platform-level limitation and granted a concession in
   `aristanetworks/sonic-qual.msft#1176`.

2. Post-PR sonic-net#20304 `tests/decap/test_decap.py::test_decap` is no longer
   parametrized at collection time. The `supported_ttl_dscp_params`
   fixture returns a single `{ttl, dscp, vxlan}` dict at runtime based on
   the DUT's APP_DB / ASIC heuristics. As a result, pytest collects
   exactly one item per session (`decap/test_decap.py::test_decap`, with
   no parametrize suffix). All `decap/test_decap.py::test_decap[ttl=*,
   dscp=*, vxlan=*]:` entries in `tests_mark_conditions.yaml` match zero
   items and have been doing so since 2025-08-28.

The skip belongs on the top-level `decap/test_decap.py:` rule, which is
the only rule that pytest's conditional_mark plugin still matches against
the single collected `test_decap` item.

Verification
------------

Empirically verified on `testbed-bjw2-can-720dt-6` (m0, internal-202511):

  * Baseline (no patch): pytest reports `1 error in 8.56s` (`test_decap`
    proceeds past conditional_mark and errors at the `duthosts` fixture).
  * With this patch: pytest reports `1 skipped, 9 warnings in 2.98s` --
    `test_decap` is marked SKIPPED by conditional_mark before any fixture
    fires.
  * Removing the eight stale parametrize-keyed entries did not change the
    behaviour vs adding the top-level skip alone (they were already
    matching nothing).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Xichen Lin <lukelin0907@gmail.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

@ZhaohuiS ZhaohuiS left a comment

Choose a reason for hiding this comment

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

Well-documented change. The conditions_logical_operator: or is correctly added for the two independent skip triggers (topo vs hwsku), and the 8 stale parametrize-keyed entries have been dead since #20304 refactored test_decap into a single non-parametrized item. The three-way verification (baseline / full PR / skip-only sub-patch) in the description confirms the stale-entry removal is purely cosmetic.

@Xichen96 Xichen96 merged commit 3deb8db into sonic-net:master May 15, 2026
25 checks passed
@mssonicbld
Copy link
Copy Markdown
Collaborator

@Xichen96 PR conflicts with 202511 branch

Blueve pushed a commit that referenced this pull request May 15, 2026
## Description of PR

Remove the four orphaned pytest CLI options registered in
`tests/decap/__init__.py`:

- `--ttl_uniform`
- `--dscp_uniform`
- `--no_ttl_uniform`
- `--no_dscp_uniform`

## Why

PR #20304 refactored `tests/decap/conftest.py`. It removed
`pytest_generate_tests` and `build_ttl_dscp_params`, and replaced them
with the `supported_ttl_dscp_params` fixture, which returns a single
`{ttl, dscp, vxlan}` dict at runtime based on the DUT's APP_DB / ASIC
heuristics. That refactor left the four `--*_uniform` options registered
with no consumer.

The companion conditional_mark cleanup PR (#24626) removes the
parametrize-keyed entries these options used to drive. A grep across
`origin/master` and `origin/202511` confirms that no file in the public
sonic-mgmt repo references `--ttl_uniform`, `--dscp_uniform`,
`--no_ttl_uniform`, or `--no_dscp_uniform` outside the `addoption` block
itself.

Removing the dead options keeps the test surface honest. The
`--outer_ipv4` / `--outer_ipv6` / `--inner_ipv4` / `--inner_ipv6`
options are still in use and remain.

## Approach

Pure deletion in `tests/decap/__init__.py` — −25 lines, no additions.

## How to verify it

`pytest --collect-only tests/decap/test_decap.py` still collects exactly
**one** item (`decap/test_decap.py::test_decap`), identical to before.
After this change, passing `--no_dscp_uniform` will be rejected by
pytest as `unrecognized arguments`, surfacing dead invocations rather
than silently doing nothing.

## Related

- Refactor that orphaned the flags: **#20304**
- Companion conditional_mark cleanup (skip on Arista-720DT + remove
stale parametrize entries): **#24626**
- Tracking issue: **aristanetworks/sonic-qual.msft#1176**

## Backports

Backports handled by automation after master merges.

Signed-off-by: Xichen Lin <lukelin0907@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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