Fix: wrong arg order of testify/assert#1421
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug by correcting the argument order in testify/assert calls in various test files. The changes ensure that the expected value is passed before the actual value, improving test readability and consistency.
- Fixed argument order in assert.Equal calls.
- Standardized test assertions across multiple components.
- Improved test consistency in status, workload, telemetry, ads, and cache modules.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/status/status_server_test.go | Updates assert.Equal argument ordering in server metric handlers. |
| pkg/controller/workload/workload_processor_test.go | Updates expected vs. actual order in IP equality assertions. |
| pkg/controller/workload/cache/waypoint_cache_test.go | Standardizes assert.Equal ordering for cache length validations. |
| pkg/controller/bpfcache/endpoint_test.go | Updates assert.Equal ordering for endpoint count verifications. |
| pkg/controller/telemetry/metric_test.go | Corrects assert.Equal ordering for connection metrics checks. |
| pkg/controller/ads/convert_filter_test.go | Changes assert.Equal argument order for cluster name validation. |
| pkg/controller/ads/ads_processor_test.go | Updates assert.Equal ordering for nonce and DNS cluster count checks. |
| pkg/cache/v2/listener_test.go | Fixes assert.Equal argument order for listener API status assertions. |
Comments suppressed due to low confidence (1)
pkg/status/status_server_test.go:461
- The method name 'GetWorklaodMetricTrigger' appears to have a typo. Consider renaming it to 'GetWorkloadMetricTrigger' for clarity.
assert.Equal(t, false, server.xdsClient.WorkloadController.GetWorklaodMetricTrigger())
Signed-off-by: Tom <yusencao@outlook.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
see 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
@Flying-Tom have u checked all the asserts.Equal |
|
/lgtm |
Most |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1420
Special notes for your reviewer:
Does this PR introduce a user-facing change?: