testkube
testkube copied to clipboard
K6 - tests from git-file fail to start
Describe the bug It's not possible to run K6 tests from git-file.
To Reproduce Steps to reproduce the behavior:
- Create a K6 test from git-file with CLI:
tk create test --type k6/script --git-uri https://github.com/kubeshop/testkube.git --git-branch performance-tests --git-path "test/perf/stress-low.js" --name perf-output-test-6 --test-content-type git-file
or with CRD:
apiVersion: tests.testkube.io/v3
kind: Test
metadata:
name: perf-output-test-6
namespace: testkube
spec:
type: k6/script
content:
type: git-file
repository:
type: git
uri: https://github.com/kubeshop/testkube.git
branch: performance-tests
path: test/perf/stress-low.js
- Run the test
- Check the result
Status test execution failed:
⨯ process error: exit status 255
$ kubectl logs 6333601c812766f26c0cf182-85v9d -n testkube
W0927 22:42:39.212018 98744 gcp.go:119] WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.26+; use gcloud instead.
To learn more, consult https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
Defaulted container "6333601c812766f26c0cf182" out of: 6333601c812766f26c0cf182, 6333601c812766f26c0cf182-init (init)
{"type":"event","content":"running test [6333601c812766f26c0cf182]"}
{"type":"event","content":"Running [/data k6 [run test-content]]"}
{"type":"line","content":"\n /\\ |‾‾| /‾‾/ /‾‾/ \n /\\ / \\ | |/ / / / \n / \\/ \\ | ( / ‾‾\\ \n / \\ | |\\ \\ | (‾) | \n / __________ \\ |__| \\__\\ \\_____/ .io\n\n"}
{"type":"line","content":"time=\"2022-09-27T20:42:10Z\" level=warning msg=\"The moduleSpecifier \\\"test-content\\\" has no scheme but we will try to resolve it as remote module. This will be deprecated in the future and all remote modules will need to explicitly use \\\"https\\\" as scheme.\"\n"}
{"type":"line","content":"time=\"2022-09-27T20:42:10Z\" level=error msg=\"The moduleSpecifier \\\"test-content\\\" couldn't be found on local disk. Make sure that you've specified the right path to the file. If you're running k6 using the Docker image make sure you have mounted the local directory (-v /local/path/:/inside/docker/path) containing your script and modules so that they're accessible by k6 from inside of the container, see https://k6.io/docs/using-k6/modules#using-local-modules-with-docker. Additionally it was tried to be loaded as remote module by prepending \\\"https://\\\" to it, which also didn't work. Remote resolution error: \\\"Get \\\"https://test-content\\\": dial tcp: lookup test-content on 10.27.240.10:53: no such host\\\"\"\n"}
{"type":"result","result":{"status":"failed","errorMessage":"process error: exit status 255"}}
Expected behavior K6 test created from git-file should be started correctly.
Version / Cluster
Client Version 1.5.32
Server Version v1.5.35
git-files also using Curl is failing. Appears to me that this is happening across many executors.
This one affect git-file
with all executors: https://github.com/kubeshop/testkube/issues/2326, but only when the test is created with dashboard.
I also checked curl before I created this issue as K6-specific - curl test started correctly with git-file
and correct path
set:
apiVersion: tests.testkube.io/v3
kind: Test
metadata:
name: curl-git-file
namespace: testkube
spec:
type: curl/test
content:
type: git-file
repository:
type: git-file
uri: https://github.com/kubeshop/testkube.git
branch: main
path: test/curl/curl.json
But, it's possible that it may not work correctly also for other executors - it would need to be checked for all of them.