Skip to content

Commit 8cac29b

Browse files
committed
fix linit
1 parent df3fa5e commit 8cac29b

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

test/e2e/crds/v2/consumer.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,17 @@ spec:
286286
applier.MustApplyAPIv2(types.NamespacedName{Namespace: s.Namespace(), Name: "test-consumer"}, &apiv2.ApisixConsumer{}, basicAuth)
287287

288288
By("verify ApisixRoute with ApisixConsumer")
289-
Eventually(request).WithArguments("/get", "invalid-username", "invalid-password").WithTimeout(5 * time.Second).ProbeEvery(time.Second).Should(Equal(http.StatusUnauthorized))
289+
Eventually(request).WithArguments("/get", "invalid-username", "invalid-password").
290+
WithTimeout(5 * time.Second).ProbeEvery(time.Second).Should(Equal(http.StatusUnauthorized))
290291

291292
Eventually(request).WithArguments("/get", "test-user", "test-password").WithTimeout(5 * time.Second).ProbeEvery(time.Second).Should(Equal(http.StatusOK))
292293

293294
By("Delete ApisixConsumer")
294295
err := s.DeleteResource("ApisixConsumer", "test-consumer")
295296
Expect(err).ShouldNot(HaveOccurred(), "deleting ApisixConsumer")
296-
Eventually(request).WithArguments("/get", "test-user", "test-password").WithTimeout(5 * time.Second).ProbeEvery(time.Second).Should(Equal(http.StatusUnauthorized))
297+
Eventually(request).WithArguments("/get", "test-user", "test-password").
298+
WithTimeout(5 * time.Second).ProbeEvery(time.Second).
299+
Should(Equal(http.StatusUnauthorized))
297300

298301
By("delete ApisixRoute")
299302
err = s.DeleteResource("ApisixRoute", "default")
@@ -321,12 +324,16 @@ spec:
321324
Expect(err).ShouldNot(HaveOccurred(), "updating Secret for ApisixConsumer")
322325

323326
Eventually(request).WithArguments("/get", "foo", "bar").WithTimeout(5 * time.Second).ProbeEvery(time.Second).Should(Equal(http.StatusUnauthorized))
324-
Eventually(request).WithArguments("/get", "foo-new-user", "bar-new-password").WithTimeout(5 * time.Second).ProbeEvery(time.Second).Should(Equal(http.StatusOK))
327+
Eventually(request).WithArguments("/get", "foo-new-user", "bar-new-password").
328+
WithTimeout(5 * time.Second).ProbeEvery(time.Second).
329+
Should(Equal(http.StatusOK))
325330

326331
By("Delete ApisixConsumer")
327332
err = s.DeleteResource("ApisixConsumer", "test-consumer")
328333
Expect(err).ShouldNot(HaveOccurred(), "deleting ApisixConsumer")
329-
Eventually(request).WithArguments("/get", "foo-new-user", "bar-new-password").WithTimeout(5 * time.Second).ProbeEvery(time.Second).Should(Equal(http.StatusUnauthorized))
334+
Eventually(request).WithArguments("/get", "foo-new-user", "bar-new-password").
335+
WithTimeout(5 * time.Second).ProbeEvery(time.Second).
336+
Should(Equal(http.StatusUnauthorized))
330337

331338
By("delete ApisixRoute")
332339
err = s.DeleteResource("ApisixRoute", "default")

test/e2e/crds/v2/route.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,22 @@ spec:
204204
match:
205205
paths:
206206
- /*
207-
filter_func: "function(vars)\n local core = require ('apisix.core')\n local body, err = core.request.get_body()\n if not body then\n return false\n end\n\n local data, err = core.json.decode(body)\n if not data then\n return false\n end\n\n if data['foo'] == 'bar' then\n return true\n end\n\n return false\nend"
207+
filter_func: |
208+
function(vars)
209+
local core = require ('apisix.core')
210+
local body, err = core.request.get_body()
211+
if not body then
212+
return false
213+
end
214+
local data, err = core.json.decode(body)
215+
if not data then
216+
return false
217+
end
218+
if data['foo'] == 'bar' then
219+
return true
220+
end
221+
return false
222+
end
208223
backends:
209224
- serviceName: httpbin-service-e2e-test
210225
servicePort: 80

0 commit comments

Comments
 (0)