TRANSCEIVER-101,102 fix as per README#4771
TRANSCEIVER-101,102 fix as per README#4771snaragund wants to merge 3 commits intoopenconfig:mainfrom
Conversation
- Added 800zr testbed in runtests.go
- Removed unwanted Nokia deviation `eth_channel_ingress_parameters_unsupported`.
- As per README changed functions under zr_validation.go
i. Configured oper-mode, frequency & targetOpticalPower with admin-state Up.
ii. Removed redundant interface admin-state bouncing.
"This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind."
Summary of ChangesHello @snaragund, 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 enhances the transceiver testing framework by adding support for the 800ZR testbed, removing an unnecessary Nokia deviation, and refining the configuration and validation processes within the ZR validation logic. These changes improve the accuracy and reliability of transceiver 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 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 counter productive. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces several fixes and improvements. It adds a new 800ZR testbed, removes an unnecessary Nokia deviation, and simplifies the ZR validation tests by removing redundant interface state bouncing. The changes also include a fix for a parameter in a telemetry validation function call.
My review focuses on improving code maintainability by addressing code duplication in the test validation logic. I've suggested refactoring the repeated validation blocks into helper functions to make the code cleaner and easier to manage. Overall, the changes are positive and improve the test suite.
| for _, p := range dut.Ports() { | ||
| validateInterfaceTelemetry(t, dut, p, params, oc.Interface_OperStatus_UP, interfaceStreams[p.Name()]) | ||
| validateTranscieverTelemetry(t, dut, p, params, oc.Interface_OperStatus_UP, trStreams[p.Name()]) | ||
| validateTempSensorTelemetry(t, dut, p, params, oc.Interface_OperStatus_DOWN, tempSensorStreams[p.Name()]) | ||
| validateTempSensorTelemetry(t, dut, p, params, oc.Interface_OperStatus_UP, tempSensorStreams[p.Name()]) | ||
| validateOpticalChannelTelemetry(t, p, params, oc.Interface_OperStatus_UP, ochStreams[p.Name()]) | ||
| validateHWPortTelemetry(t, dut, p, params, hwPortStreams[p.Name()]) | ||
| } |
There was a problem hiding this comment.
This block of code for validating the 'UP' state of platform telemetry is duplicated later in the function (lines 191-197). To improve maintainability and reduce redundancy, consider extracting this logic into a dedicated helper function, for example validatePlatformTelemetryUp, and call it here and on line 191.
Here's a possible implementation for the helper function:
func validatePlatformTelemetryUp(t *testing.T, dut *ondatra.DUTDevice, params *cfgplugins.ConfigParameters, interfaceStreams map[string]*samplestream.SampleStream[*oc.Interface], trStreams map[string]*samplestream.SampleStream[*oc.Component], tempSensorStreams map[string]*samplestream.SampleStream[*oc.Component], ochStreams map[string]*samplestream.SampleStream[*oc.Component], hwPortStreams map[string]*samplestream.SampleStream[*oc.Component]) {
t.Helper()
for _, p := range dut.Ports() {
validateInterfaceTelemetry(t, dut, p, params, oc.Interface_OperStatus_UP, interfaceStreams[p.Name()])
validateTranscieverTelemetry(t, dut, p, params, oc.Interface_OperStatus_UP, trStreams[p.Name()])
validateTempSensorTelemetry(t, dut, p, params, oc.Interface_OperStatus_UP, tempSensorStreams[p.Name()])
validateOpticalChannelTelemetry(t, p, params, oc.Interface_OperStatus_UP, ochStreams[p.Name()])
validateHWPortTelemetry(t, dut, p, params, hwPortStreams[p.Name()])
}
} validatePlatformTelemetryUp(t, dut, params, interfaceStreams, trStreams, tempSensorStreams, ochStreams, hwPortStreams)
Pull Request Test Coverage Report for Build 18978157371Details
💛 - Coveralls |
eth_channel_ingress_parameters_unsupported.validateTempSensorTelemetryfunction call."This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind."