From ee2ac342e1ec27a8b78c97475f3b243913595542 Mon Sep 17 00:00:00 2001 From: Alex Hyett Date: Wed, 27 Sep 2023 10:38:43 +0100 Subject: [PATCH] Add hostname variable --- tests/load-test.js | 1 + tests/simple-test.js | 1 - tests/soak-test.js | 1 + tests/spike-test.js | 1 + tests/stress-test.js | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/load-test.js b/tests/load-test.js index 4ee2c1b..3d82da4 100644 --- a/tests/load-test.js +++ b/tests/load-test.js @@ -2,6 +2,7 @@ import http from 'k6/http'; import { sleep } from 'k6'; import { SharedArray } from 'k6/data'; +var hostname = __ENV.HOSTNAME; if (hostname == null) hostname = 'localhost:5157'; export const options = { diff --git a/tests/simple-test.js b/tests/simple-test.js index a715042..1256614 100644 --- a/tests/simple-test.js +++ b/tests/simple-test.js @@ -1,7 +1,6 @@ import http from 'k6/http'; var hostname = __ENV.HOSTNAME; - if (hostname == null) hostname = 'localhost:5157'; export const options = { diff --git a/tests/soak-test.js b/tests/soak-test.js index 76a140a..136a4f6 100644 --- a/tests/soak-test.js +++ b/tests/soak-test.js @@ -2,6 +2,7 @@ import http from 'k6/http'; import { sleep } from 'k6'; import { SharedArray } from 'k6/data'; +var hostname = __ENV.HOSTNAME; if (hostname == null) hostname = 'localhost:5157'; export const options = { diff --git a/tests/spike-test.js b/tests/spike-test.js index 2fb6846..5519063 100644 --- a/tests/spike-test.js +++ b/tests/spike-test.js @@ -2,6 +2,7 @@ import http from 'k6/http'; import { sleep } from 'k6'; import { SharedArray } from 'k6/data'; +var hostname = __ENV.HOSTNAME; if (hostname == null) hostname = 'localhost:5157'; export const options = { diff --git a/tests/stress-test.js b/tests/stress-test.js index db6b355..1aee852 100644 --- a/tests/stress-test.js +++ b/tests/stress-test.js @@ -2,6 +2,7 @@ import http from 'k6/http'; import { sleep } from 'k6'; import { SharedArray } from 'k6/data'; +var hostname = __ENV.HOSTNAME; if (hostname == null) hostname = 'localhost:5157'; export const options = {