This is an automated email from the ASF dual-hosted git repository.
ashishtiwari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git
The following commit(s) were added to refs/heads/master by this push:
new 40712363 chore(test): Refactor loop to use range over integer in test
(#2494)
40712363 is described below
commit 40712363d01ee9394eeafc9b2ae8fe0d7e2caa44
Author: iliya <[email protected]>
AuthorDate: Tue Aug 5 23:35:09 2025 +0900
chore(test): Refactor loop to use range over integer in test (#2494)
---
test/e2e/crds/v1alpha1/consumer.go | 2 +-
test/e2e/gatewayapi/httproute.go | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/e2e/crds/v1alpha1/consumer.go
b/test/e2e/crds/v1alpha1/consumer.go
index daa092cd..dc68ddf7 100644
--- a/test/e2e/crds/v1alpha1/consumer.go
+++ b/test/e2e/crds/v1alpha1/consumer.go
@@ -190,7 +190,7 @@ spec:
Check: scaffold.WithExpectedStatus(503),
})
- for i := 0; i < 10; i++ {
+ for range 10 {
s.RequestAssert(&scaffold.RequestAssert{
Method: "GET",
Path: "/get",
diff --git a/test/e2e/gatewayapi/httproute.go b/test/e2e/gatewayapi/httproute.go
index f4012aa1..09150453 100644
--- a/test/e2e/gatewayapi/httproute.go
+++ b/test/e2e/gatewayapi/httproute.go
@@ -1676,7 +1676,7 @@ spec:
hitNginxCnt = 0
hitHttpbinCnt = 0
)
- for i := 0; i < 20; i++ {
+ for range 20 {
resp := s.NewAPISIXClient().GET("/get").
WithHeader("Host",
"httpbin.example").
Expect()
@@ -1702,7 +1702,7 @@ spec:
hitNginxCnt = 0
hitHttpbinCnt = 0
)
- for i := 0; i < 20; i++ {
+ for range 20 {
resp := s.NewAPISIXClient().GET("/get").
WithHeader("Host",
"httpbin.example").
Expect()
@@ -1879,7 +1879,7 @@ spec:
upstreamHosts := make(map[string]int)
totalRequests := 20
- for i := 0; i < totalRequests; i++ {
+ for range totalRequests {
statusCode :=
s.NewAPISIXClient().GET("/headers").Expect().Raw().StatusCode
Expect(statusCode).To(Or(Equal(http.StatusOK),
Equal(http.StatusMovedPermanently)))