-
Notifications
You must be signed in to change notification settings - Fork 134
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
[Feature Request] Add queuing process on Testkube to trigger the testsuite. #5463
Comments
thank you @trangpkaxon looks like an intersting feature. for @TheBrunoLopes and @jmorante-ks to analyze and prioritize |
@trangpkaxon , I can give an update on this topic. TestSuites are being deprecated in favor of Test Workflows For Test Workflows we have in roadmap enhancements that could cover your queue needs. We do not have ETA for them yet, we will let you know once we have it confirmed. |
@trangpkaxon For Test Workflows we have a workaround - a special testworkflow template, that should be included in such queuing test workflows. All test worrkflows will be launched, but only one will be active, when other will wait for a free slot - @rangoo94 |
Hi, the template @vsukhin mentioned basically looks like this: kind: TestWorkflowTemplate
apiVersion: testworkflows.testkube.io/v1
metadata:
name: limit-concurrency
spec:
config:
concurrency:
type: integer
default: 1
delay:
type: number
description: delay seconds
default: 2
setup:
- name: Waiting for free slot
run:
image: kubeshop/testkube-cli
shell: |
echo "Concurrency: {{ config.concurrency }}"
while true
do
ALL="$({{ shellquote(
"testkube", "get", "twe", "-c", "direct", "--api-uri", "http://testkube-api-server:8088",
"--testworkflow", workflow.name, "-o", "go", "--go-template", "{{ .Number }} {{ .Result.Status }} {{ .Id }}\n"
) }} | grep -E 'queued|running|paused' | sort -h | sed -E 's/([^ ]* )*//')"
RUNNABLE="$(echo "$ALL" | head -{{ int(config.concurrency) }})"
ORDER="$(echo "$ALL" | grep -n "{{ execution.id }}" | sed -E "s/:.*//")"
if [ -z "$(echo "$RUNNABLE" | grep "{{ execution.id }}")" ]; then
echo "Current position: $ORDER ($(( ORDER - {{ int(config.concurrency) }} )) needs to finish to continue)"
sleep {{ float(config.delay) }}
else
echo "Current position: $ORDER... Starting!"
exit 0
fi
done It's quite simple - it's calling the API Server to get information if there are any other executions in progress, and advancing to the next step when it's ready. The deprecated Test Suites are represented by kind: TestWorkflow
apiVersion: testworkflows.testkube.io/v1
metadata:
name: example-no-concurrency
spec:
use:
- name: limit-concurrency
config:
concurrency: 1 # maximum workflows to run at once
delay: 1 # seconds between consecutive checks
steps:
# regular steps, i.e. the test-suite like scheduler
- execute:
# parallelism: 3 # optionally, limit how many of the workflows below could be run in parallel
workflows:
- name: some-name
- name: some-name-2
- name: some-name-3 The kind: TestWorkflow
apiVersion: testworkflows.testkube.io/v1
metadata:
name: example-no-concurrency
spec:
use:
- name: limit-concurrency
config:
concurrency: 1 # maximum workflows to run at once
delay: 1 # seconds between consecutive checks
steps:
- run:
image: kubeshop/testkube-cli:latest
shell: |
testkube -c direct --api-uri "http://testkube-api-server:8088" run tw -f some-name
testkube -c direct --api-uri "http://testkube-api-server:8088" run tw -f some-name-2
testkube -c direct --api-uri "http://testkube-api-server:8088" run tw -f some-name-3 |
Is your feature request related to a problem? Please describe.
Step reproduce
For example, we have test suite A
Actual:
=> In this case, the testscript may have conflicting data that is utilized to perform
Expectation:
Additional context
https://github.com/kubeshop/testkube/assets/162653239/53276f6d-8383-46dc-a920-99cc229b070d
The text was updated successfully, but these errors were encountered: