# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1649229729 -7200
#      Wed Apr 06 09:22:09 2022 +0200
# Node ID 4e7dfc05eb3c5336b53412a05819d64f6c59916c
# Parent  3dde52d26cb5c987dc530d23b9269dd8eba73d09
📝 do_tests: stop tests if there is no module to test

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,11 @@
 History
 =======
 
+16.1.0
+------
+
+Shell script: avoid running tests if there is no module to test.
+
 16.0.0
 ------
 
diff --git a/do_tests b/do_tests
--- a/do_tests
+++ b/do_tests
@@ -37,7 +37,14 @@
 fi
 echo "$DEBUG Looking for modules to install"
 modules_to_install=${ODOO_SCRIPTS_MODULE_LIST-$(read_odoo_scripts_expandable_configuration_key module_list)}
-echo "$DEBUG Modules to install: $modules_to_install"
+echo "$DEBUG module_list=$modules_to_install"
+modules_to_tests=${ODOO_SCRIPTS_MODULE_LIST-$(read_odoo_scripts_expandable_configuration_key module_list_tests)}
+echo "$DEBUG module_list_tests=$modules_to_tests"
+if [[ -z "$modules_to_tests" ]];
+then
+    echo "$INFO No module to tests"
+    exit 0
+fi
 echo "$DEBUG Looking value of fail_on_errors"
 fail_on_errors=${ODOO_SCRIPTS_FAIL_ON_ERRORS-$(read_odoo_scripts_configuration_key fail_on_errors True)}
 echo "$DEBUG fail_on_errors=$fail_on_errors"