mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 12:16:41 +02:00
ci-automation: Add a kola test query runner
It makes sure that the output of it is purely a list of kola tests to run, without all the other unnecessary stuff.
This commit is contained in:
parent
63a6f60971
commit
bdebbc8ed9
@ -324,7 +324,6 @@ function run_kola_tests_on_instances() {
|
||||
# rest of the parameters are tests to be run or rerun
|
||||
|
||||
local instance_type
|
||||
local queried_tests
|
||||
local instance_tests=()
|
||||
local tests_on_instances_running=0
|
||||
local other_tests_for_fgrep
|
||||
@ -342,8 +341,7 @@ function run_kola_tests_on_instances() {
|
||||
# to filter the extra tests first then we decide which tests
|
||||
# should be run.
|
||||
if [[ "${is_first_run}" -eq 1 ]]; then
|
||||
queried_tests="$(query_kola_tests "${instance_type}" "${@}")"
|
||||
mapfile -t instance_tests < <(grep --only-matching --fixed-strings "${other_tests_for_fgrep}" <<<"${queried_tests}" || :)
|
||||
mapfile -t instance_tests < <(run_query_kola_tests "${instance_type}" "${@}" | grep --only-matching --fixed-strings "${other_tests_for_fgrep}" || :)
|
||||
else
|
||||
filter_prefixed_tests instance_tests "${instance_type}" "${@}"
|
||||
fi
|
||||
@ -385,3 +383,11 @@ function run_kola_tests_on_instances() {
|
||||
rm -f 'instance_'*'_validate.tap'
|
||||
fi
|
||||
}
|
||||
|
||||
# Runs the user-defined query_kola_tests callback and massages its
|
||||
# output so only a list of tests is printed.
|
||||
function run_query_kola_tests() {
|
||||
# The "-n +3" option will skip the table header and the empty line
|
||||
# that follows it.
|
||||
query_kola_tests "${@}" | tail -n +3 | awk '{ print $1 }'
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user