Open AshDerTest opened 2 years ago
The webhook has to have access to the files. The solution I've thought of is to allow bundling scripts within config maps: https://github.com/grafana/flagger-k6-webhook/issues/7. It's not done yet though because we are having good success with single files (even extremely large ones)
Any idea if or timeline you are looking at to implement this? Reason I ask is that we have the k6 tests running in pipeline (using the multiple fiiles) and attempting not to duplicate this and paste into single script against flagger during deployment.
import http from 'k6/http'; import { sleep, check } from 'k6'; import { Counter } from 'k6/metrics';
export const requests = new Counter('http_reqs');
export default function test1() {
const res = http.get('http://{{ include "test.fullname" . }}-canary.{{- .Release.Namespace }}:{{ .Values.service.port }}');
sleep(1);
const checkRes = check(res, { status is 200': (r) => r.status === 200 }); }
I'm not planning on implementing this soon. Reasons being:
Though, I am open to contributions on this if you'd like to open a PR
i believe the easies way is to store "./test1.js" into an extra layer of the Containerfile.
Hi
Just a query with regards to the current webhook, is it possible to run predefined js scripts as part of the webhook or is tis limited to running embedded script in the canary yaml?
Current k6 setup: Main file below to import methods from other files (current example has 1 other file but can be expanded to include more)
second file test1.js
Not sure if this is a limitation on flagger, helm or is possible to be catered for in the webhook?