Skip to content

Commit f92bd13

Browse files
committed
chore: integration: add tests for __raw_url__ handling
1 parent cb760ff commit f92bd13

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

integration/integration_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ func TestSMK6(t *testing.T) {
156156
"error": {"probe_http_info"},
157157
"expected_response": {"probe_http_got_expected_response"},
158158
"group": {},
159+
"__raw_url__": {},
159160
}
160161

161162
for _, mf := range mfs {
@@ -319,6 +320,12 @@ func TestSMK6(t *testing.T) {
319320
metricLabels: map[string]string{"tls_version": "1.3", "url": "https://test-api.k6.io/public/crocodiles/"},
320321
assertValue: any, // Just fail if not present.
321322
},
323+
{
324+
name: "__raw_url__ overrides url",
325+
metricName: "probe_http_requests_total",
326+
metricLabels: map[string]string{"url": "foobar"},
327+
assertValue: equals(1),
328+
},
322329
} {
323330
tc := tc
324331
t.Run(tc.name, func(t *testing.T) {

integration/test-script.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ export default function () {
3939
http.get(`http://${testHost}`); // non-https.
4040
http.get(`https://${testHost}/public/crocodiles/`);
4141
http.get(`https://${testHost}/public/crocodiles2/`); // 404
42-
http.get(`https://${testHost}/public/crocodiles3/`); // 404
42+
http.get(`https://${testHost}/public/crocodiles3/`, {
43+
tags: {
44+
'__raw_url__': 'foobar',
45+
}
46+
}); // 404
4347
http.get(`https://${testHost}/public/crocodiles4/`); // 404
4448
http.get(`https://${testHost}/public/crocodiles4/`); // Second 404, to assert differences between failure rate and counter.
4549
http.get(`http://fail.internal/public/crocodiles4/`); // failed

0 commit comments

Comments
 (0)