From 21cf55307c2867fb05ef53e3f4b27904302b16b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mari=C3=A1n=20Macik?= Date: Tue, 7 Apr 2020 10:54:13 +0200 Subject: [PATCH] KOGITO-1044 - Kogito runtime performance and load tests (#257) --- hack/run-tests.sh | 5 +++++ hack/run-tests.sh.bats | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/hack/run-tests.sh b/hack/run-tests.sh index fe1775a35..0e6557c78 100755 --- a/hack/run-tests.sh +++ b/hack/run-tests.sh @@ -41,6 +41,7 @@ function usage(){ printf "\n--timeout {TIMEOUT_IN_MINUTES}\n\tSet a timeout overall tests run in minutes. Default is 240." printf "\n--debug\n\tRun in debug mode." printf "\n--smoke\n\tFilter to run only the tests tagged with '@smoke'." + printf "\n--performance\n\tFilter to run only the tests tagged with '@performance'. If not provided and the tag itself is not specified, these tests will be ignored." printf "\n--load_factor {INT_VALUE}\n\tSet the tests load factor. Useful for the tests to take into account that the cluster can be overloaded, for example for the calculation of timouts. Default value is 1." printf "\n--local\n\tSpecify whether you run test in local." printf "\n--ci {CI_NAME}\n\tSpecify whether you run test with ci, give also the name of the CI." @@ -163,6 +164,10 @@ case $1 in addParam "--tests.smoke" shift ;; + --performance) + addParam "--tests.performance" + shift + ;; --load_factor) shift if addParamKeyValueIfAccepted "--tests.load-factor" ${1}; then shift; fi diff --git a/hack/run-tests.sh.bats b/hack/run-tests.sh.bats index c5a527697..6dad770a5 100644 --- a/hack/run-tests.sh.bats +++ b/hack/run-tests.sh.bats @@ -116,6 +116,18 @@ [[ "${output}" != *"--tests.smoke"* ]] } +@test "invoke run-tests with performance" { + run ${BATS_TEST_DIRNAME}/run-tests.sh --performance --dry_run + [ "$status" -eq 0 ] + [[ "${output}" =~ "--tests.performance" ]] +} + +@test "invoke run-tests without performance" { + run ${BATS_TEST_DIRNAME}/run-tests.sh --dry_run + [ "$status" -eq 0 ] + [[ "${output}" != *"--tests.performance"* ]] +} + @test "invoke run-tests with load_factor" { run ${BATS_TEST_DIRNAME}/run-tests.sh --load_factor 3 --dry_run [ "$status" -eq 0 ]