new check for single RE#5436
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the telemetry inventory test suite by adding support for single Routing Engine (RE) devices and enhancing regex matching for NPU components. These changes ensure that subcomponent validation is appropriately skipped for single-controller configurations and that multi-digit NPU identifiers are correctly processed during testing. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
Pull Request Functional Test Report for #5436 / f76b650Virtual Devices
Hardware Devices
|
There was a problem hiding this comment.
Code Review
This pull request updates the telemetry inventory test to support multi-digit NPU identifiers in the regex and introduces logic to skip subcomponent validation for devices with a single controller card. Feedback was provided regarding the controller card count check, which currently includes the default value of -1 and causes a regression in test coverage. A suggestion was made to refine this condition to specifically target counts of 0 or 1 and to use standard characters in code comments for consistency.
| subcName := subc.GetName() | ||
| subComponent := gnmi.Lookup(t, dut, gnmi.OC().Component(subcName).State()) | ||
| if !subComponent.IsPresent() { | ||
| if *args.NumControllerCards <= 1 { // ← skip for single RE devices |
There was a problem hiding this comment.
The check *args.NumControllerCards <= 1 includes the default value of -1 (set in internal/args/args.go), which means this validation will be skipped by default on all devices where the flag is not explicitly provided. This is a regression in test coverage. The check should be restricted to valid counts of 0 or 1. Additionally, the arrow character ← is non-standard; maintain consistent code style by using standard characters in comments.
| if *args.NumControllerCards <= 1 { // ← skip for single RE devices | |
| if *args.NumControllerCards >= 0 && *args.NumControllerCards <= 1 { // skip for single RE devices |
References
- In test suites, maintaining a consistent code style across similar tests is preferred.
Added a check to skip subcomponent leaf validation when it's a Single RE i.e NumControllerCards and fixed NPU regex to fetch 2 digit NPU's as well