Skip to content

Commit

Permalink
Add summary.html artifacts for K6
Browse files Browse the repository at this point in the history
  • Loading branch information
earnestangel committed Jul 22, 2023
1 parent b740cc6 commit c5c63a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ workflows:
- test-node
# grafana/k6 orb is used to run load tests
- grafana/k6:
script: loadtests/performance-test.js > output.txt && mkdir -p /tmp/artifacts && cp -R summary.json output.txt /tmp/artifacts 2>/dev/null
script: loadtests/performance-test.js > output.txt && mkdir -p /tmp/artifacts && cp -R summary.json output.txt summary.html /tmp/artifacts 2>/dev/null
requires:
- build-node # run after build-node
# - deploy:
Expand Down
2 changes: 2 additions & 0 deletions loadtests/performance-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { sleep } from 'k6';
import http from 'k6/http';
import { textSummary } from 'https://jslib.k6.io/k6-summary/0.0.1/index.js';
import { htmlReport } from "https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js";

export const options = {
duration: '.5m',
Expand All @@ -21,6 +22,7 @@ export function handleSummary(data) {
console.log('Finished executing performance tests');

return {
"summary.html": htmlReport(data),
'stdout': textSummary(data, { indent: ' ', enableColors: true }), // Show the text summary to stdout...
'summary.json': JSON.stringify(data), // and a JSON with all the details...
};
Expand Down

0 comments on commit c5c63a2

Please sign in to comment.