[v2,02/12] CI: Add avocado version checking

Message ID 20230303144727.481716-3-amikan@ilbers.de
State Deferred
Headers show
Series Next avocado improvements​ | expand

Commit Message

Anton Mikanovich March 3, 2023, 2:47 p.m. UTC
We need to keep backward compatibility with older Avocado versions
until everyone will move to 100+. Then this can be reverted.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 scripts/ci_build.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Patch

diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index 37d51f7..e37114b 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -129,9 +129,17 @@  logs_dir = $(realpath "${BASE_DIR}")/job-results
 EOF
 export VIRTUAL_ENV="./"
 
+# use correct variable
+case "$(avocado --version)" in
+  *100*) PARALLEL="--max-parallel-tasks=1"
+    ;;
+  *) PARALLEL="--nrunner-max-parallel-tasks=1"
+    ;;
+esac
+
 # the real stuff starts here, trace commands from now on
 set -x
 
 avocado ${VERBOSE} run "${TESTSUITE_DIR}/citest.py" \
-    -t "${TAGS}" --max-parallel-tasks=1 --disable-sysinfo \
+    -t "${TAGS}" ${PARALLEL} --disable-sysinfo \
     -p quiet="${QUIET}" -p time_to_wait="${TIMEOUT}"