From e6b65c87b407645eeee1f1d64d7a8b3fc97f2690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Miri=C4=87?= Date: Mon, 27 Jul 2020 15:38:00 +0200 Subject: [PATCH] Check redirect request metrics in TestRequestAndBatch Resolves https://github.com/loadimpact/k6/pull/1570#discussion_r460153190 --- js/modules/k6/http/request_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/modules/k6/http/request_test.go b/js/modules/k6/http/request_test.go index 1091a986e8da..711c886a6bcc 100644 --- a/js/modules/k6/http/request_test.go +++ b/js/modules/k6/http/request_test.go @@ -206,6 +206,11 @@ func TestRequestAndBatch(t *testing.T) { } assert.Equal(t, 10, reqsCount) + assertRequestMetricsEmitted(t, bufSamples, "GET", sr("HTTPBIN_URL/redirect/9"), sr("HTTPBIN_URL/redirect/9"), 302, "") + for i := 8; i > 0; i-- { + url := sr(fmt.Sprintf("HTTPBIN_URL/relative-redirect/%d", i)) + assertRequestMetricsEmitted(t, bufSamples, "GET", url, url, 302, "") + } assertRequestMetricsEmitted(t, bufSamples, "GET", sr("HTTPBIN_URL/get"), sr("HTTPBIN_URL/get"), 200, "") })