Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The testing dependency breaks supported older Python environments, and one asynchronous state assertion is scheduling-dependent.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds live xcvr-emu integration coverage for the production CMIS transceiver stack.
Changes:
- Adds a gRPC emulator adapter and isolated daemon fixtures.
- Tests addressing, discovery, state machines, hot-plugging, and DOM decoding.
- Adds emulator configuration, documentation, pytest marker, and testing dependencies.
File summaries
| File | Description |
|---|---|
tests/sonic_xcvr/integration/xcvr_emu_config.yaml |
Defines deterministic CMIS modules. |
tests/sonic_xcvr/integration/test_cmis_emulator.py |
Adds end-to-end CMIS tests. |
tests/sonic_xcvr/integration/README.md |
Documents architecture and execution. |
tests/sonic_xcvr/integration/emulator.py |
Implements daemon, client, and SFP adapter. |
tests/sonic_xcvr/integration/conftest.py |
Provides isolated integration fixtures. |
tests/sonic_xcvr/integration/__init__.py |
Defines the integration test package. |
setup.py |
Adds the testing extra and emulator dependency. |
pytest.ini |
Registers the integration marker. |
Review details
- Files reviewed: 7/8 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+14
to
+15
| 'xcvr-emu @ git+https://github.com/az-pz/' | ||
| 'xcvr-emu.git@3aca04f89de6dfecf33bea29509234164d917a81', |
Comment on lines
+302
to
+309
| ready_cmis_api.decommission_all_datapaths() | ||
|
|
||
| assert ready_cmis_api.get_active_apsel_hostlane() == { | ||
| "ActiveAppSelLane%d" % lane: 0 for lane in range(1, 9) | ||
| } | ||
| assert ready_cmis_api.get_datapath_state() == { | ||
| "DP%dState" % lane: "DataPathDeactivated" for lane in range(1, 9) | ||
| } |
Exercise the production CMIS stack against a live transceiver emulator, including address translation, API discovery, state machines, datapath provisioning, and DOM decoding. Add the integration marker, documentation, and a testing extra pinned to the compatible az-pz/xcvr-emu fork. Signed-off-by: Ariz Zubair <arizzubair@microsoft.com>
az-pz
force-pushed
the
test/xcvr-emu-integration
branch
from
September 16, 2026 17:51
1b39b5c to
5c90960
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add integration tests that run the production SONiC CMIS transceiver stack against a live
xcvr-emuprocess instead of mocks.The change adds:
SfpOptoeBaseadapter and per-test emulator lifecycle management.integrationpytest marker and atestingpackage extra pinned to a compatibleaz-pz/xcvr-emucommit.Motivation and Context
The existing unit tests validate individual CMIS components with mocks, but they do not verify that the complete
SfpOptoeBase->XcvrApiFactory->CmisApistack reads and writes the intended registers through a live transport. These tests exercise those boundaries end to end and catch regressions in page/bank translation, field decoding, and state-machine control flows.How Has This Been Tested?
Tested in a Debian 12 Bookworm container with Python 3.11 and the SONiC build dependencies installed.
pytest tests/sonic_xcvr/integration/test_cmis_emulator.py: 53 passed.pytestsuite: 1,916 passed, 0 failed, 0 errors, 0 skipped; 72% coverage.python3 -m build -n: wheel built successfully, and its metadata contains the fork-pinnedxcvr-emudependency under thetestingextra.Additional Information (Optional)
The emulator dependency is pinned to immutable commit
az-pz/xcvr-emu@3aca04f89de6dfecf33bea29509234164d917a81, which supports current SONiC gRPC versions and package-qualified protobuf imports. The integration module skips cleanly when the optional emulator dependency is unavailable.xcvr-emu should be forked under sonic-net and that fork should be used here in the future.