From 44ee52cee72a16a0605afd111ad0b4a6b6ab2d23 Mon Sep 17 00:00:00 2001 From: Zachary Keeping Date: Thu, 20 Jun 2024 14:28:29 +1000 Subject: [PATCH 1/3] Copy k6 script folder in Dockerfile --- docker/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 4034de00..51a2c0da 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -39,6 +39,9 @@ RUN wget -q https://dl.k6.io/key.gpg -O- | apt-key add - RUN echo "deb https://dl.k6.io/deb stable main" | tee -a /etc/apt/sources.list RUN apt-get update && apt-get install -y k6 +# copy k6 scripts +COPY k6-scripts /home/lhci/app/k6-scripts + # main nodejs app COPY --from=nodeBuilder /usr/src/app /home/lhci/app From 4a8aafe2097840b650142cccd575ebfc7c3fb520 Mon Sep 17 00:00:00 2001 From: Zachary Keeping Date: Thu, 20 Jun 2024 15:33:19 +1000 Subject: [PATCH 2/3] Fix k6 download --- ui/src/containers/K6Report.svelte | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/src/containers/K6Report.svelte b/ui/src/containers/K6Report.svelte index b5325edf..3bc30497 100644 --- a/ui/src/containers/K6Report.svelte +++ b/ui/src/containers/K6Report.svelte @@ -16,13 +16,15 @@ let promise = getBuildDetails(currentRoute.namedParams.id); let userNotLoginToast; + const reportUrl = `${CONSTS.BlobURL}/k6report/${currentRoute.namedParams.id}.json`; + const download = () => { - window.location.href = `${CONSTS.BlobURL}/atr/${currentRoute.namedParams.run}.json`; + window.location.href = reportUrl; }; let k6Result = {}; - const getK6Result = async (path) => { - await fetch(`${CONSTS.BlobURL}/k6report/${path}.json`) + const getK6Result = async () => { + await fetch(reportUrl) .then((x) => x.json()) .then((res) => { k6Result = res; @@ -30,7 +32,7 @@ return k6Result; }; - let getK6Data = getK6Result(currentRoute.namedParams.id); + let getK6Data = getK6Result();
From 54aa41acedb38220d261e1003b2196a748502924 Mon Sep 17 00:00:00 2001 From: Zachary Keeping Date: Thu, 20 Jun 2024 16:01:27 +1000 Subject: [PATCH 3/3] Fix comment text --- docker/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/utils.js b/docker/utils.js index 9ddb468b..cbe030a4 100644 --- a/docker/utils.js +++ b/docker/utils.js @@ -318,8 +318,8 @@ exports.runK6LoadTest = (url, writeLog) => { } /** - * parse Lighthouse Report - * @param {string} folder - lhr file + * parse k6 Report + * @param {string} folder - k6 file * @param {func} writeLog - logging method */ exports.readK6Results = async (folder, writeLog) => {