Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The test module is quite large and covers two distinct behaviours (
detect_breakout_portsanddetect_port_channels); consider splitting it into separate files (e.g.test_breakout_detection.pyandtest_port_channel_detection.py) to keep each test suite focused and easier to navigate. - Several tests construct similar
port_configdictionaries inline; you could factor the common port_config shapes into small helper functions or fixtures (similar to_port_config_for_port) to reduce duplication and make intent clearer when reading each test.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The test module is quite large and covers two distinct behaviours (`detect_breakout_ports` and `detect_port_channels`); consider splitting it into separate files (e.g. `test_breakout_detection.py` and `test_port_channel_detection.py`) to keep each test suite focused and easier to navigate.
- Several tests construct similar `port_config` dictionaries inline; you could factor the common port_config shapes into small helper functions or fixtures (similar to `_port_config_for_port`) to reduce duplication and make intent clearer when reading each test.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Cover detect_breakout_ports and detect_port_channels in osism/tasks/conductor/sonic/interface.py with 49 test cases: early-exit paths, NetBox-format breakout for all supported speeds, SONiC-format 400G and standard breakout, and the LAG-name regex variants (named, numeric fallback, case-insensitive, unnamed). Tests are split across test_breakout_detection.py and test_port_channel_detection.py, with shared NetBox-stub helpers in _detection_helpers.py and inline port_config dicts built via a single _port_config_for_port helper. Closes #2220 AI-assisted: Claude Code Signed-off-by: Christian Berendt <berendt@osism.tech>
ideaship
approved these changes
Apr 29, 2026
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.
Cover detect_breakout_ports and detect_port_channels in osism/tasks/conductor/sonic/interface.py with 49 test cases: early-exit paths, NetBox-format breakout for all supported speeds, SONiC-format 400G and standard breakout, and the LAG-name regex variants (named, numeric fallback, case-insensitive, unnamed).
Closes #2220
AI-assisted: Claude Code