Skip to content

test: assert parsed port ranges#15264

Merged
alpeb merged 1 commit into
linkerd:mainfrom
immanuwell:test-assert-port-range
May 14, 2026
Merged

test: assert parsed port ranges#15264
alpeb merged 1 commit into
linkerd:mainfrom
immanuwell:test-assert-port-range

Conversation

@immanuwell
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @immanuwell !

@alpeb alpeb merged commit 4f94965 into linkerd:main May 14, 2026
91 of 97 checks passed
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.

2 participants