# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1650885383 -7200
#      Mon Apr 25 13:16:23 2022 +0200
# Node ID 235a970e6f555922bcee1b82a92babbdc5b2b631
# Parent  f29d5765379bab7a4a83320f7cbd4527ea7d81bb
🚑 fix test procedure

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,11 @@
 History
 =======
 
+16.5.0
+------
+
+When running tests, only install modules that are not going to be tested. Modules to be tested will be installed during the tests.
+
 16.4.0
 ------
 
diff --git a/do_tests b/do_tests
--- a/do_tests
+++ b/do_tests
@@ -36,9 +36,12 @@
     unaccent=False
 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 module_list=$modules_to_install"
+module_list=${ODOO_SCRIPTS_MODULE_LIST-$(read_odoo_scripts_expandable_configuration_key module_list)}
 modules_to_tests=${ODOO_SCRIPTS_MODULE_LIST-$(read_odoo_scripts_expandable_configuration_key module_list_tests)}
+# Install modules that will not be tested
+modules_to_install=$($python -B -c "print(','.join(set('$module_list'.split(','))-set('$modules_to_tests'.split(','))))")
+echo "$DEBUG module_list=$module_list"
+echo "$DEBUG module_to_install=$modules_to_install"
 echo "$DEBUG module_list_tests=$modules_to_tests"
 if [[ -z "$modules_to_tests" ]];
 then
diff --git a/run_tests b/run_tests
--- a/run_tests
+++ b/run_tests
@@ -13,7 +13,7 @@
 
 if [[ "$tested_modules" != "" ]];
 then 
-    update="-u $tested_modules"
+    update="-i $tested_modules"
 fi
 dbname=$1
 if [[ -z "$dbname" ]];