[v2,1/2] ci: allow multiple test suites to run in one job

Message ID 20200228041904.195597-2-ruifeng.wang@arm.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series no-huge test suite |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Ruifeng Wang Feb. 28, 2020, 4:19 a.m. UTC
  Run multiple test suites in a single Travis CI job helps to avoid
job bloating and save build time.

When RUN_TESTS is set, TEST_SUITES includes a list of suites that
need to run in the job, otherwise fast-tests is run by default.

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
---
 .ci/linux-build.sh |  4 +++-
 .ci/linux-setup.sh | 16 +++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)
  

Patch

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d500c4c00..ddb925418 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -90,5 +90,7 @@  if [ "$ABI_CHECKS" = "1" ]; then
 fi
 
 if [ "$RUN_TESTS" = "1" ]; then
-    sudo meson test -C build --suite fast-tests -t 3
+    for testsuite in ${TEST_SUITES:-fast-tests}; do
+        sudo meson test -C build --suite $testsuite -t 3
+    done
 fi
diff --git a/.ci/linux-setup.sh b/.ci/linux-setup.sh
index 2b07d1e0b..4c5ddeb96 100755
--- a/.ci/linux-setup.sh
+++ b/.ci/linux-setup.sh
@@ -3,10 +3,16 @@ 
 # need to install as 'root' since some of the unit tests won't run without it
 sudo python3 -m pip install --upgrade 'meson==0.47.1'
 
-# skip hugepage settings if tests will not run
+# set up hugepage if fast-tests suite (default) will run
 if [ "$RUN_TESTS" = "1" ]; then
-    # setup hugepages
-    cat /proc/meminfo
-    sudo sh -c 'echo 1024 > /proc/sys/vm/nr_hugepages'
-    cat /proc/meminfo
+    for testsuite in ${TEST_SUITES:-fast-tests}; do
+        if [ "$testsuite" = "fast-tests" ]; then
+            # setup hugepages
+            cat /proc/meminfo
+            sudo sh -c 'echo 1024 > /proc/sys/vm/nr_hugepages'
+            cat /proc/meminfo
+
+            break
+        fi
+    done
 fi