[IMP] refactoring to support multiple version of Odoo
- change path odoo to support multiple - conf pycharm exclude folder - refactor run/test/coverage by use same script
This commit is contained in:
parent
6cfe176557
commit
a1b9c98b5f
20 changed files with 94 additions and 82 deletions
13
Makefile
13
Makefile
|
|
@ -92,12 +92,12 @@ pyenv_update:
|
|||
.PHONY: db_create_db_test
|
||||
db_create_db_test:
|
||||
./script/make.sh db_drop_db_test
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --create --database test
|
||||
./odoo_bin.sh db --create --database test
|
||||
|
||||
.PHONY: db_clone_test_to_test2
|
||||
db_clone_test_to_test2:
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --drop --database test2
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --clone --database test2 --from_database test
|
||||
./odoo_bin.sh db --drop --database test2
|
||||
./odoo_bin.sh db --clone --database test2 --from_database test
|
||||
|
||||
.PHONY: db_test_export
|
||||
db_test_export:
|
||||
|
|
@ -279,6 +279,11 @@ config_gen_image_db:
|
|||
./script/git/git_repo_update_group.py --group base,image_db
|
||||
./script/generate_config.sh
|
||||
|
||||
.PHONY: config_gen_migration
|
||||
config_gen_migration:
|
||||
./script/git/git_repo_update_group.py --group base,addons,migration
|
||||
./script/generate_config.sh
|
||||
|
||||
##########
|
||||
# I18n #
|
||||
##########
|
||||
|
|
@ -286,7 +291,7 @@ config_gen_image_db:
|
|||
# i18n generation demo_portal
|
||||
.PHONY: i18n_generate_demo_portal
|
||||
i18n_generate_demo_portal:
|
||||
./.venv/bin/python3 ./odoo/odoo-bin i18n --database code_generator --module demo_portal --addons_path addons/TechnoLibre_odoo-code-generator
|
||||
./odoo_bin.sh i18n --database code_generator --module demo_portal --addons_path addons/TechnoLibre_odoo-code-generator
|
||||
|
||||
###########
|
||||
# Clean #
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@ db_restore_erplibre_base_db_template:
|
|||
|
||||
.PHONY: db_drop_db_code_generator
|
||||
db_drop_db_code_generator:
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --drop --database code_generator
|
||||
./odoo_bin.sh db --drop --database code_generator
|
||||
|
||||
.PHONY: db_drop_db_template
|
||||
db_drop_db_template:
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --drop --database template
|
||||
./odoo_bin.sh db --drop --database template
|
||||
|
||||
.PHONY: db_test_re_export_website_attachments
|
||||
db_test_re_export_website_attachments:
|
||||
|
|
@ -289,7 +289,7 @@ test_code_generator_demo_mariadb_sql_example_1:
|
|||
.PHONY: test_addons_code_generator
|
||||
test_addons_code_generator:
|
||||
./.venv/bin/coverage erase
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --drop --database test_addons_code_generator
|
||||
./odoo_bin.sh db --drop --database test_addons_code_generator
|
||||
# TODO missing test in code_generator
|
||||
./test.sh --dev cg -d test_addons_code_generator --db-filter test_addons_code_generator -i code_generator
|
||||
./.venv/bin/coverage combine -a
|
||||
|
|
|
|||
|
|
@ -4,27 +4,27 @@
|
|||
|
||||
.PHONY: db_list
|
||||
db_list:
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --list
|
||||
./odoo_bin.sh db --list
|
||||
|
||||
.PHONY: db_list_incompatible_database
|
||||
db_list_incompatible_database:
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --list_incompatible_db
|
||||
./odoo_bin.sh db --list_incompatible_db
|
||||
|
||||
.PHONY: db_version
|
||||
db_version:
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --version
|
||||
./odoo_bin.sh db --version
|
||||
|
||||
.PHONY: db_drop_db_test
|
||||
db_drop_db_test:
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --drop --database test
|
||||
./odoo_bin.sh db --drop --database test
|
||||
|
||||
.PHONY: db_drop_db_test2
|
||||
db_drop_db_test2:
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --drop --database test2
|
||||
./odoo_bin.sh db --drop --database test2
|
||||
|
||||
.PHONY: db_drop_db_test3
|
||||
db_drop_db_test3:
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --drop --database test3
|
||||
./odoo_bin.sh db --drop --database test3
|
||||
|
||||
.PHONY: db_drop_all
|
||||
db_drop_all:
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
.PHONY: image_db_create_erplibre_code_generator
|
||||
image_db_create_erplibre_code_generator:
|
||||
./script/make.sh addons_install_code_generator_basic
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --backup --database code_generator --restore_image erplibre_code_generator_basic
|
||||
./odoo_bin.sh db --backup --database code_generator --restore_image erplibre_code_generator_basic
|
||||
./script/make.sh addons_install_code_generator_featured
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --backup --database code_generator --restore_image erplibre_code_generator_featured
|
||||
./odoo_bin.sh db --backup --database code_generator --restore_image erplibre_code_generator_featured
|
||||
./script/make.sh addons_install_code_generator_full
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --backup --database code_generator --restore_image erplibre_code_generator_full
|
||||
./odoo_bin.sh db --backup --database code_generator --restore_image erplibre_code_generator_full
|
||||
|
||||
.PHONY: image_db_create_all_parallel
|
||||
image_db_create_all_parallel:
|
||||
|
|
@ -35,8 +35,8 @@ image_db_list:
|
|||
image_db_create_test_website_attachments:
|
||||
./script/database/db_restore.py --database code_generator_test_website_attachements --image test_website_attachments
|
||||
# Do your stuff
|
||||
./.venv/bin/python3 ./odoo/odoo-bin --limit-time-real 999999 --no-http -c config.conf --stop-after-init -d code_generator_test_website_attachements -u all
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --backup --database code_generator_test_website_attachements --restore_image test_website_attachments
|
||||
./odoo_bin.sh --limit-time-real 999999 --no-http -c config.conf --stop-after-init -d code_generator_test_website_attachements -u all
|
||||
./odoo_bin.sh db --backup --database code_generator_test_website_attachements --restore_image test_website_attachments
|
||||
|
||||
.PHONY: image_diff_base_website
|
||||
image_diff_base_website:
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ test_installation_demo:
|
|||
.PHONY: test_addons_sale
|
||||
test_addons_sale:
|
||||
./.venv/bin/coverage erase
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --drop --database test_addons_sale
|
||||
./odoo_bin.sh db --drop --database test_addons_sale
|
||||
./test.sh -d test_addons_sale --db-filter test_addons_sale -i sale
|
||||
./.venv/bin/coverage combine -a
|
||||
./.venv/bin/coverage report -m
|
||||
|
|
@ -113,7 +113,7 @@ test_addons_sale:
|
|||
.PHONY: test_addons_helpdesk
|
||||
test_addons_helpdesk:
|
||||
./.venv/bin/coverage erase
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --drop --database test_addons_helpdesk
|
||||
./odoo_bin.sh db --drop --database test_addons_helpdesk
|
||||
./test.sh -d test_addons_helpdesk --db-filter test_addons_helpdesk -i helpdesk_mgmt
|
||||
./.venv/bin/coverage combine -a
|
||||
./.venv/bin/coverage report -m
|
||||
|
|
|
|||
|
|
@ -10,3 +10,7 @@ artifacts
|
|||
cache
|
||||
htmlcov
|
||||
node_modules
|
||||
.venv
|
||||
odoo
|
||||
screencasts
|
||||
screenshots
|
||||
|
|
|
|||
|
|
@ -1,21 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
source ./.venv/bin/activate
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
export ODOO_MODE_COVERAGE="true"
|
||||
|
||||
CONFIG_PATH="./config.conf"
|
||||
ORIGIN_CONFIG_PATH=CONFIG_PATH
|
||||
if [ ! -f "${CONFIG_PATH}" ]; then
|
||||
CONFIG_PATH="/etc/odoo/odoo.conf"
|
||||
if [ ! -f "${CONFIG_PATH}" ]; then
|
||||
echo "${Red}Cannot find${Color_Off} ERPLibre configuration ${ORIGIN_CONFIG_PATH}, did you install ERPLibre? > make install"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
coverage run -p ./odoo/odoo-bin -c "${CONFIG_PATH}" --limit-time-real 99999 --limit-time-cpu 99999 "$@"
|
||||
retVal=$?
|
||||
if [[ $retVal -ne 0 ]]; then
|
||||
echo "${Red}Error${Color_Off} run.sh"
|
||||
exit 1
|
||||
fi
|
||||
./run.sh "$@"
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<!-- [en] -->
|
||||
Never run this on production environment, this create circular dependencies and will cause frustration to clean damage.
|
||||
<!-- [fr] -->
|
||||
Ne jamais exécuter le générateur de code dans un environnement de production, il y a création de dépendances circulaires pouvant causer de la frustration à nettoyer tous les dommages. D'ailleurs, il est nécessaire d'exécuter en mode développement, avec l'argument `--dev cg`.
|
||||
Ne jamais exécuter le générateur de code dans un environnement de production, il y a création de dépendances circulaires pouvant causer de la frustration à nettoyer tous les dommages. D'ailleurs, il est nécessaire d'exécuter en mode développement, avec l'argument `--dev cg`.
|
||||
|
||||
L'objectif du générateur de code est de :
|
||||
- utiliser le générateur via l'interface web;
|
||||
|
|
@ -592,7 +592,7 @@ des informations dans la base de données.
|
|||
Supposons que le nom de votre BD est `test_website` :
|
||||
|
||||
```bash
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test_website --restore_image test_website_backup
|
||||
./odoo_bin.sh db --backup --database test_website --restore_image test_website_backup
|
||||
./script/database/db_restore.py --database test_website_2 --image test_website_backup.zip --clean_cache
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Comment générer du code
|
||||
|
||||
Ne jamais exécuter le générateur de code dans un environnement de production, il y a création de dépendances circulaires pouvant causer de la frustration à nettoyer tous les dommages. D'ailleurs, il est nécessaire d'exécuter en mode développement, avec l'argument `--dev cg`.
|
||||
Ne jamais exécuter le générateur de code dans un environnement de production, il y a création de dépendances circulaires pouvant causer de la frustration à nettoyer tous les dommages. D'ailleurs, il est nécessaire d'exécuter en mode développement, avec l'argument `--dev cg`.
|
||||
|
||||
L'objectif du générateur de code est de :
|
||||
- utiliser le générateur via l'interface web;
|
||||
|
|
@ -402,7 +402,7 @@ des informations dans la base de données.
|
|||
Supposons que le nom de votre BD est `test_website` :
|
||||
|
||||
```bash
|
||||
./.venv/bin/python3 ./odoo/odoo-bin db --backup --database test_website --restore_image test_website_backup
|
||||
./odoo_bin.sh db --backup --database test_website --restore_image test_website_backup
|
||||
./script/database/db_restore.py --database test_website_2 --image test_website_backup.zip --clean_cache
|
||||
```
|
||||
|
||||
|
|
|
|||
16
odoo_bin.sh
Executable file
16
odoo_bin.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
source ./.venv/bin/activate
|
||||
|
||||
ODOO_PATH="$(pwd)/odoo$(< .odoo-version)"
|
||||
#export PATH=$ODOO_PATH:$PATH
|
||||
#echo $PATH
|
||||
#echo $PYTHONPATH
|
||||
#export PYTHONPATH="${ODOO_PATH}:${ODOO_PATH}/addons:$PYTHONPATH"
|
||||
export PYTHONPATH="${ODOO_PATH}:$PYTHONPATH"
|
||||
#echo $PYTHONPATH
|
||||
|
||||
if [ "$ODOO_MODE_COVERAGE" = "true" ]; then
|
||||
coverage run -p ./odoo$(< .odoo-version)/odoo/odoo-bin "$@"
|
||||
else
|
||||
python3 ./odoo$(< .odoo-version)/odoo/odoo-bin "$@"
|
||||
fi
|
||||
7
run.sh
7
run.sh
|
|
@ -1,5 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
source ./.venv/bin/activate
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
|
|
@ -13,7 +12,11 @@ if [ ! -f "${CONFIG_PATH}" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
python3 ./odoo/odoo-bin -c "${CONFIG_PATH}" --limit-time-real 99999 --limit-time-cpu 99999 --limit-memory-hard=0 "$@"
|
||||
if [ "$ODOO_MODE_TEST" = "true" ]; then
|
||||
./odoo_bin.sh -c "${CONFIG_PATH}" --limit-time-real 99999 --limit-time-cpu 99999 --limit-memory-hard=0 --log-level=test --test-enable --no-http --stop-after-init "$@"
|
||||
else
|
||||
./odoo_bin.sh -c "${CONFIG_PATH}" --limit-time-real 99999 --limit-time-cpu 99999 --limit-memory-hard=0 "$@"
|
||||
fi
|
||||
# When need more memory RAM for instance by force
|
||||
#python3 ./odoo/odoo-bin -c ${CONFIG_PATH} --limit-time-real 99999 --limit-time-cpu 99999 --limit-memory-soft=8589934592 --limit-memory-hard=10737418240 $@
|
||||
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ class ProjectManagement:
|
|||
|
||||
if not self.keep_bd_alive:
|
||||
cmd = (
|
||||
"./.venv/bin/python3 ./odoo/odoo-bin db --drop --database"
|
||||
"./odoo_bin.sh db --drop --database"
|
||||
f" {bd_name_demo}"
|
||||
)
|
||||
_logger.info(cmd)
|
||||
|
|
@ -468,7 +468,7 @@ class ProjectManagement:
|
|||
|
||||
if not self.keep_bd_alive:
|
||||
cmd = (
|
||||
"./.venv/bin/python3 ./odoo/odoo-bin db --drop --database"
|
||||
"./odoo_bin.sh db --drop --database"
|
||||
f" {bd_name_template}"
|
||||
)
|
||||
_logger.info(cmd)
|
||||
|
|
@ -539,7 +539,7 @@ class ProjectManagement:
|
|||
|
||||
if not self.keep_bd_alive:
|
||||
cmd = (
|
||||
"./.venv/bin/python3 ./odoo/odoo-bin db --drop --database"
|
||||
"./odoo_bin.sh db --drop --database"
|
||||
f" {bd_name_generator}"
|
||||
)
|
||||
_logger.info(cmd)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ def get_config():
|
|||
def main():
|
||||
config = get_config()
|
||||
|
||||
out_db = execute_shell("./.venv/bin/python3 ./odoo/odoo-bin db --list")
|
||||
out_db = execute_shell("./odoo_bin.sh db --list")
|
||||
lst_db = out_db.split("\n")
|
||||
for db_name in lst_db:
|
||||
if config.test_only and not (
|
||||
|
|
@ -47,7 +47,7 @@ def main():
|
|||
):
|
||||
continue
|
||||
execute_shell(
|
||||
"./.venv/bin/python3 ./odoo/odoo-bin db --drop --database"
|
||||
"./odoo_bin.sh db --drop --database"
|
||||
f" {db_name}"
|
||||
)
|
||||
print(f"{db_name} deleted")
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ def get_list_db_cache(arg_base):
|
|||
def main():
|
||||
config = get_config()
|
||||
|
||||
arg_base = "./.venv/bin/python3 ./odoo/odoo-bin db"
|
||||
arg_base = "./odoo_bin.sh db"
|
||||
|
||||
if not config.image:
|
||||
with open(".odoo-version", "r") as f:
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ def main():
|
|||
|
||||
# Step 0, drop and restore
|
||||
cmd_drop_db = (
|
||||
f"{PYTHON_BIN} ./odoo/odoo-bin db --drop --database {bd_temp_name}"
|
||||
f"./odoo_bin.sh db --drop --database {bd_temp_name}"
|
||||
)
|
||||
all_temp_bd.append(bd_temp_name)
|
||||
run_cmd(cmd_drop_db)
|
||||
|
|
@ -310,7 +310,7 @@ def main():
|
|||
with_demo = dct_config_image.get("with_demo")
|
||||
# Create a new one
|
||||
cmd = (
|
||||
f"{PYTHON_BIN} ./odoo/odoo-bin db --create --database"
|
||||
f"./odoo_bin.sh db --create --database"
|
||||
f" {bd_temp_name}"
|
||||
)
|
||||
if with_demo:
|
||||
|
|
@ -343,7 +343,7 @@ def main():
|
|||
else f"{image_name_to_generate}_{pkg_name}"
|
||||
)
|
||||
cmd = (
|
||||
f"{PYTHON_BIN} ./odoo/odoo-bin db --backup --database"
|
||||
f"./odoo_bin.sh db --backup --database"
|
||||
f" {bd_temp_name} --restore_image {module_image_name}"
|
||||
)
|
||||
run_cmd(cmd)
|
||||
|
|
@ -353,7 +353,7 @@ def main():
|
|||
if not config.keep_database:
|
||||
for db_name in all_temp_bd:
|
||||
cmd_drop_db = (
|
||||
f"{PYTHON_BIN} ./odoo/odoo-bin db --drop --database {db_name}"
|
||||
f"./odoo_bin.sh db --drop --database {db_name}"
|
||||
)
|
||||
run_cmd(cmd_drop_db)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,5 +4,5 @@ if [ $# -lt 1 ]; then
|
|||
echo "Missing database name"
|
||||
exit 1
|
||||
fi
|
||||
source ./.venv/bin/activate
|
||||
python3 ./odoo/odoo-bin -c ./config.conf --limit-time-real 99999 --limit-time-cpu 99999 --no-http --stop-after-init -i user_test,disable_mail_server,disable_auto_backup --dev prod -d $@
|
||||
|
||||
./odoo_bin.sh -c ./config.conf --limit-time-real 99999 --limit-time-cpu 99999 --no-http --stop-after-init -i user_test,disable_mail_server,disable_auto_backup --dev prod -d $@
|
||||
|
|
|
|||
|
|
@ -1151,9 +1151,7 @@ class SeleniumLib(object):
|
|||
chiffre = str(random.randint(0, 9))
|
||||
troisieme_lettre = chr(random.randint(65, 90))
|
||||
|
||||
code_postal = (
|
||||
f"{premiere_lettre}{chiffre}{deuxieme_lettre} {chiffre}{troisieme_lettre}{chiffre}"
|
||||
)
|
||||
code_postal = f"{premiere_lettre}{chiffre}{deuxieme_lettre} {chiffre}{troisieme_lettre}{chiffre}"
|
||||
|
||||
return code_postal
|
||||
|
||||
|
|
|
|||
|
|
@ -756,8 +756,7 @@ async def test_exec(
|
|||
|
||||
if is_db_create:
|
||||
res, status = await run_command(
|
||||
"./.venv/bin/python3",
|
||||
"./odoo/odoo-bin",
|
||||
"./odoo_bin.sh",
|
||||
"db",
|
||||
"--drop",
|
||||
"--database",
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ VERSION_ODOO_FILE = os.path.join(".odoo-version")
|
|||
VERSION_POETRY_FILE = os.path.join(".poetry-version")
|
||||
VENV_FILE = os.path.join(".venv")
|
||||
ADDONS_PATH = os.path.join("addons")
|
||||
ODOO_PATH = os.path.join(".", "odoo")
|
||||
VENV_TEMPLATE_FILE = ".venv.%s"
|
||||
MANIFEST_FILE = "default.dev.xml"
|
||||
MANIFEST_TEMPLATE_FILE = "default.dev.odoo%s.xml"
|
||||
|
|
@ -39,6 +40,7 @@ PIP_IGNORE_REQUIREMENT_FILE = os.path.join(
|
|||
)
|
||||
PIP_IGNORE_REQUIREMENT_TEMPLATE_FILE = "ignore_requirements.%s.txt"
|
||||
ADDONS_TEMPLATE_FILE = "addons.odoo%s"
|
||||
ODOO_TEMPLATE_FILE = "odoo%s"
|
||||
ERPLIBRE_TEMPLATE_VERSION = "odoo%s_python%s"
|
||||
|
||||
|
||||
|
|
@ -145,6 +147,9 @@ class Update:
|
|||
self.new_version_odoo = None
|
||||
self.new_version_python = None
|
||||
self.new_version_poetry = None
|
||||
self.expected_odoo_name = None
|
||||
self.expected_odoo_path = None
|
||||
self.expected_addons_name = None
|
||||
self.expected_venv_name = None
|
||||
self.expected_manifest_name = None
|
||||
self.expected_manifest_path = None
|
||||
|
|
@ -317,6 +322,8 @@ class Update:
|
|||
self.expected_addons_name = (
|
||||
ADDONS_TEMPLATE_FILE % self.new_version_odoo
|
||||
)
|
||||
self.expected_odoo_name = ODOO_TEMPLATE_FILE % self.new_version_odoo
|
||||
self.expected_odoo_path = os.path.join(".", self.expected_odoo_name, "odoo", ".")
|
||||
self.expected_pip_requirement_path = os.path.join(
|
||||
".", "requirement", self.expected_pip_requirement_name
|
||||
)
|
||||
|
|
@ -344,6 +351,14 @@ class Update:
|
|||
venv_exist = os.path.exists(VENV_FILE)
|
||||
if not venv_exist and not self.config.install_dev:
|
||||
_logger.info("Relaunch this script with --install_dev argument.")
|
||||
# Validate Odoo repo
|
||||
status &= self.update_link_file(
|
||||
"Odoo repository",
|
||||
ODOO_PATH,
|
||||
self.expected_odoo_path,
|
||||
is_directory=True,
|
||||
do_delete_source=True,
|
||||
)
|
||||
# Validate Git repo
|
||||
status &= self.update_link_file(
|
||||
"Git repositories",
|
||||
|
|
@ -418,7 +433,9 @@ class Update:
|
|||
txt.write(self.new_version_poetry)
|
||||
|
||||
if self.config.is_in_installation or self.config.is_in_switch:
|
||||
addons_path_with_version = f"addons.odoo{self.new_version_odoo}"
|
||||
addons_path_with_version = (
|
||||
ADDONS_TEMPLATE_FILE % self.new_version_odoo
|
||||
)
|
||||
# To support multiple addons directory, change name before run git repo
|
||||
for addons_path in os.listdir("."):
|
||||
if (
|
||||
|
|
@ -613,7 +630,9 @@ class Update:
|
|||
do_delete_source = do_delete_source or os.path.exists(
|
||||
target_file
|
||||
)
|
||||
if ref_symlink_source_from_root == target_file:
|
||||
if os.path.normpath(
|
||||
ref_symlink_source_from_root
|
||||
) == os.path.normpath(target_file):
|
||||
_logger.info(
|
||||
f"{component_name}:The system configuration is good."
|
||||
)
|
||||
|
|
|
|||
21
test.sh
21
test.sh
|
|
@ -1,22 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
# Usage, ./test.sh -d test_addons_name -i module_name
|
||||
source ./.venv/bin/activate
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
CONFIG_PATH="./config.conf"
|
||||
ORIGIN_CONFIG_PATH=CONFIG_PATH
|
||||
if [ ! -f "${CONFIG_PATH}" ]; then
|
||||
CONFIG_PATH="/etc/odoo/odoo.conf"
|
||||
if [ ! -f "${CONFIG_PATH}" ]; then
|
||||
echo "${Red}Cannot find${Color_Off} ERPLibre configuration ${ORIGIN_CONFIG_PATH}, did you install ERPLibre? > make install"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
export ODOO_MODE_COVERAGE="true"
|
||||
export ODOO_MODE_TEST="true"
|
||||
|
||||
coverage run -p ./odoo/odoo-bin -c "${CONFIG_PATH}" --limit-time-real 99999 --limit-time-cpu 99999 --log-level=test --test-enable --no-http --stop-after-init "$@"
|
||||
retVal=$?
|
||||
if [[ $retVal -ne 0 ]]; then
|
||||
echo "${Red}Error${Color_Off} run.sh"
|
||||
exit 1
|
||||
fi
|
||||
./run.sh "$@"
|
||||
|
|
|
|||
Loading…
Reference in a new issue