Skip to content

test: assert parsed port ranges#15264

Open
immanuwell wants to merge 1 commit into
linkerd:mainfrom
immanuwell:test-assert-port-range
Open

test: assert parsed port ranges#15264
immanuwell wants to merge 1 commit into
linkerd:mainfrom
immanuwell:test-assert-port-range

Conversation

@immanuwell
Copy link
Copy Markdown

Tiny test hardening PR.

TestParsePortRange called reflect.DeepEqual but dropped the bool, so the test could go green even when the parsed range was wrong. small but real, imo.

Repro on main:

  • change the first expected range in pkg/util/portrange_test.go from 23-23 to 24-24
  • run go test ./pkg/util
  • it still passes, which is not what we want

This makes the test fail on bad parsed ranges and on unexpected errors.

Validation:

  • go test ./pkg/util
  • go test ./pkg/inject ./pkg/util
  • go vet ./pkg/util

@immanuwell immanuwell requested a review from a team as a code owner May 11, 2026 16:15
Signed-off-by: Immanuel Tikhonov <122638311+immanuwell@users.noreply.github.com>
@immanuwell immanuwell force-pushed the test-assert-port-range branch from eb44694 to a70903f Compare May 11, 2026 16:16
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