# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1627997390 -7200
#      Tue Aug 03 15:29:50 2021 +0200
# Node ID e38cee9c00b722cbbea25ffd7878947d4657fffd
# Parent  00ece27eec7644d2d190c5a7f28876bee0a6521f
🚑 update tests to newer base image

And also avoid sleep, just restart odoo after installing modules

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,7 +13,9 @@
   stage: test
   needs: []
   image:
-    name: registry.xcg.io/odoo/odoo:11.0-bionic
+    # ci runners do not get the latest 11.0-bionic, so use the hash
+    #name: registry.xcg.io/odoo/odoo:11.0-bionic
+    name: registry.xcg.io/odoo/odoo:hg-9d8e9462c31889244df9569ed9ac159599d17472
     entrypoint: [""]
   services:
   - name: postgres:12-alpine
@@ -25,32 +27,40 @@
     ODOO_ADDONS_PATH: ""
     ODOO_TYPE: odoo11
   before_script:
-  - pip3 install $CI_PROJECT_DIR --disable-pip-version-check --no-cache-dir
-  - apt update && apt install zsh -yq
+  # install modules
+  - $CI_PROJECT_DIR/start --db_host=db -d test_setup --max-cron-threads=0 --without-demo=all --data-dir /var/lib/odoo --init base --stop-after-init
   script:
-  - sudo --preserve-env -u odoo $CI_PROJECT_DIR/start --db_host=db -d test_setup --max-cron-threads=0 --without-demo=all --data-dir /var/lib/odoo --init base &
-  # wait for odoo to install the modules
-  - sleep 35
+  # restart odoo with installed modules and use it in background
+  - $CI_PROJECT_DIR/start --db_host=db -d test_setup --max-cron-threads=0 --data-dir /var/lib/odoo &
+  - sleep 3
   # then test the setup files
   - import_jsonrpc -v --host localhost --password admin -d test_setup --protocol jsonrpc -p 8069 --directory tests/import
   - import_jsonrpc -v --host localhost --password admin -d test_setup --protocol jsonrpc -p 8069 --file tests/context_import/res.company.csv --context test=value
   - import_jsonrpc -v --host localhost --password admin -d test_setup --protocol jsonrpc -p 8069 --directory tests/import_emptyyaml --delimiter ";"
-  - import_sql -vv --host postgres --user odoo --database test_setup --directory tests/import_sql
+  - import_sql -v --host postgres --user odoo --database test_setup --directory tests/import_sql
+  # clean up background process
+  - pkill --echo --full /usr/bin/python3
+  - pkill --echo --full zsh
 
 import_base_import_odoo11_test:
   extends: import_jsonrpc_odoo11_test
   script:
-  - sudo --preserve-env -u odoo $CI_PROJECT_DIR/start --db_host=db -d test_setup --max-cron-threads=0 --without-demo=all --data-dir /var/lib/odoo --init base &
-  # wait for odoo to install the modules
-  - sleep 35
+  # restart odoo with installed modules and use it in background
+  - $CI_PROJECT_DIR/start --db_host=db -d test_setup --max-cron-threads=0 --data-dir /var/lib/odoo &
+  - sleep 3
   # then test the setup files
   - import_base_import -v --host localhost --password admin -d test_setup --protocol jsonrpc -p 8069 --directory tests/import
   - import_sql -vv --host postgres --user odoo --database test_setup --directory tests/import_sql
+  # clean up background process
+  - pkill --echo --full /usr/bin/python3
+  - pkill --echo --full zsh
 
 import_jsonrpc_odoo13_test:
   extends: import_jsonrpc_odoo11_test
   image:
-    name: registry.xcg.io/odoo/odoo:13.0
+    # ci runners do not get the latest 13.0, so use the hash
+    #name: registry.xcg.io/odoo/odoo:13.0
+    name: registry.xcg.io/odoo/odoo:hg-05143ce629ed64d9b4d4713df4443ff4dddd3d9f
     entrypoint: [""]
   variables:
     ODOO_TYPE: odoo13
@@ -58,7 +68,9 @@
 import_base_import_odoo13_test:
   extends: import_base_import_odoo11_test
   image:
-    name: registry.xcg.io/odoo/odoo:13.0
+    # ci runners do not get the latest 13.0, so use the hash
+    #name: registry.xcg.io/odoo/odoo:13.0
+    name: registry.xcg.io/odoo/odoo:hg-05143ce629ed64d9b4d4713df4443ff4dddd3d9f
     entrypoint: [""]
   variables:
     ODOO_TYPE: odoo13
@@ -86,7 +98,7 @@
   - pip3 install .
   - cd doc
   - pip3 install -r requirements hg-evolve
-  - for language in en fr ; do LANGUAGE=$language BUILDDIRSUFFIX=/$(hg identify --debug --branch) make html ; done
+  - for language in en fr ; do LANGUAGE=$language BUILDDIRSUFFIX=/$CI_COMMIT_HG_BRANCH make html ; done
 
 publish_documentation:
   needs:
diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,13 +2,15 @@
 History
 =======
 
-8.0.2
+9.0.0
 -----
 
 Add install option to do_tests, allowing to override installed modules.
 
 Fix issues with documentation generation (incompatibility with expand)
 
+Changed following base image changes.
+
 8.0.1
 -----
 
diff --git a/odoo_scripts/docker_dev_start.py b/odoo_scripts/docker_dev_start.py
--- a/odoo_scripts/docker_dev_start.py
+++ b/odoo_scripts/docker_dev_start.py
@@ -847,6 +847,7 @@
             )
 
     # avoid chowning at each run, faster but can cause trouble
+    # newer odoo images does not use this environment variable anymore
     options["environment"]["ODOO_CHOWN"] = "false"
 
     if coverage: