Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Mobile | Fix issue with k6 not running in Docker #916

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docker/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
10 changes: 6 additions & 4 deletions ui/src/containers/K6Report.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@
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;
});
return k6Result;
};

let getK6Data = getK6Result(currentRoute.namedParams.id);
let getK6Data = getK6Result();
</script>

<div class="container mx-auto">
Expand Down
Loading