[FIX] test from 01 to 04

This commit is contained in:
Sylvain LE GAL 2022-06-28 16:45:44 +02:00
parent 451be8c389
commit 4d3bb66e4e
6 changed files with 34 additions and 25 deletions

View File

@ -13,8 +13,8 @@ def test_cli_init():
"--log-level=DEBUG",
"init",
"--project-name=test-cli",
"--initial-version=13.0",
"--final-version=14.0",
"--initial-version=14.0",
"--final-version=15.0",
"--extra-repository="
"OCA/web,OCA/server-tools,OCA/bank-statement-import",
]

View File

@ -12,14 +12,12 @@ def test_cli_get_code():
]
)
# Check V13
openupgrade_path = Path("./src/env_13.0/src/openupgrade")
assert openupgrade_path.exists()
# Check V14
web_path = Path("./src/env_14.0/src/OCA/web")
assert web_path.exists()
assert (openupgrade_path / Path("odoo")).exists()
# check V14
openupgrade_path = Path("./src/env_14.0/src/openupgrade")
# check V15
openupgrade_path = Path("./src/env_15.0/src/openupgrade")
assert openupgrade_path.exists()

View File

@ -9,16 +9,16 @@ def test_cli_docker_build():
[
"--log-level=DEBUG",
"docker-build",
"--versions=13.0,14.0",
"--versions=14.0,15.0",
]
)
docker_client = get_docker_client()
assert docker_client.images.get(
"odoo-openupgrade-wizard-image__test-cli__13.0"
"odoo-openupgrade-wizard-image__test-cli__14.0"
)
assert docker_client.images.get(
"odoo-openupgrade-wizard-image__test-cli__14.0"
"odoo-openupgrade-wizard-image__test-cli__15.0"
)

View File

@ -1,7 +1,10 @@
from pathlib import Path
from odoo_openupgrade_wizard.tools.tools_docker import get_docker_client
from odoo_openupgrade_wizard.tools.tools_postgres import execute_sql_request
from odoo_openupgrade_wizard.tools.tools_postgres import (
ensure_database,
execute_sql_request,
)
from . import (
build_ctx_from_config_file,
@ -12,7 +15,11 @@ from . import (
def test_cli_run():
move_to_test_folder()
ctx = build_ctx_from_config_file()
db_name = "database_test_cli___run"
ensure_database(ctx, db_name, state="absent")
cli_runner_invoke(
[
"--log-level=DEBUG",
@ -29,7 +36,6 @@ def test_cli_run():
assert db_filestore_path.exists()
# Ensure that 'base' module is installed
ctx = build_ctx_from_config_file()
request = (
"SELECT id"
" FROM ir_module_module"

View File

@ -2,7 +2,10 @@ from pathlib import Path
from plumbum.cmd import cp
from odoo_openupgrade_wizard.tools.tools_postgres import execute_sql_request
from odoo_openupgrade_wizard.tools.tools_postgres import (
ensure_database,
execute_sql_request,
)
from . import (
build_ctx_from_config_file,
@ -13,6 +16,8 @@ from . import (
def test_cli_execute_script_python():
move_to_test_folder()
ctx = build_ctx_from_config_file()
extra_script_path = Path("../extra_script/click_odoo_test.py").absolute()
cp(
extra_script_path,
@ -20,6 +25,7 @@ def test_cli_execute_script_python():
)
db_name = "database_test_cli___execute_script_python"
ensure_database(ctx, db_name, state="absent")
# Install Odoo on V13 with base installed
cli_runner_invoke(
@ -34,7 +40,6 @@ def test_cli_execute_script_python():
)
# Compute partners quantity
ctx = build_ctx_from_config_file()
request = "SELECT count(*)" " FROM res_partner;"
partner_quantity_before = int(
execute_sql_request(ctx, request, database=db_name)[0][0]

View File

@ -8,32 +8,32 @@ odoo_default_country_code: FR
odoo_versions:
- 13.0
- 14.0
- 15.0
odoo_version_settings:
13.0:
repo_url: False
14.0:
repo_url: False
15.0:
repo_url: False
migration_steps:
- name: 1
version: 13.0
version: 14.0
execution_context: regular
complete_name: step_01__update__13.0
complete_name: step_01__update__14.0
- name: 2
version: 14.0
version: 15.0
execution_context: openupgrade
complete_name: step_02__upgrade__14.0
complete_name: step_02__upgrade__15.0
- name: 3
version: 14.0
version: 15.0
execution_context: regular
complete_name: step_03__update__14.0
complete_name: step_03__update__15.0
workload_settings: