Skip to content

fix: use spectrumXTestConfig helper in TestBuildCIDRPoolsFromAIR2Tier - #199

Open
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:codequality/addressing-test-use-spectrumxtestconfig-helper-in
Open

fix: use spectrumXTestConfig helper in TestBuildCIDRPoolsFromAIR2Tier#199
andrewwhitecdw wants to merge 1 commit into
NVIDIA:mainfrom
andrewwhitecdw:codequality/addressing-test-use-spectrumxtestconfig-helper-in

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

This PR addresses the following issue in pkg/networkoperatorplugin/spectrumx/addressing_test.go: use spectrumXTestConfig helper in TestBuildCIDRPoolsFromAIR2Tier.

Changes

  • pkg/networkoperatorplugin/spectrumx/addressing_test.go: use spectrumXTestConfig helper in TestBuildCIDRPoolsFromAIR2Tier.

Details

--- a/pkg/networkoperatorplugin/spectrumx/addressing_test.go
+++ b/pkg/networkoperatorplugin/spectrumx/addressing_test.go
@@ -1,10 +1,2 @@
-			cfg := &config.LaunchKitConfig{
-				Profile: &config.Profile{SpectrumX: &config.ProfileSpectrumX{
-					Enable:         true,
-					TopologyType:   config.SpectrumXTopology2Tier,
-					IPVersion:      config.SpectrumXIPVersionIPv4,
-					TopologyFile:   topologyPath,
-					MultiplaneMode: tt.mode,
-					NumberOfPlanes: 4,
-				}},
-			}
+			cfg := spectrumXTestConfig(topologyPath, tt.mode)
+			cfg.Profile.SpectrumX.NumberOfPlanes = 4

Tests

  • pkg/networkoperatorplugin/spectrumx/addressing_test.go

Contributor guidelines

Per this repo's CONTRIBUTING.md:

  • All commits are signed off (Signed-off-by trailer, DCO).

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

Greptile Summary

This PR refactors TestBuildCIDRPoolsFromAIR2Tier to construct its Spectrum-X configuration with the shared test helper while preserving the previous four-plane setting.

  • Replaces the duplicated LaunchKitConfig literal with spectrumXTestConfig.
  • Retains NumberOfPlanes: 4 through an explicit override.

Confidence Score: 5/5

The PR appears safe to merge because the helper-based configuration preserves the test's prior inputs and behavior.

The helper initializes the same two-tier IPv4 Spectrum-X fields as the removed literal, and the explicit override preserves the prior four-plane value.

Important Files Changed

Filename Overview
pkg/networkoperatorplugin/spectrumx/addressing_test.go The test now uses the shared configuration helper, and the resulting configuration remains equivalent to the removed inline literal.

Reviews (1): Last reviewed commit: "fix: use spectrumXTestConfig helper in T..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant