Skip to content

Commit

Permalink
[IMP] More Compact Debug Logs
Browse files Browse the repository at this point in the history
  • Loading branch information
joshkreud committed Nov 21, 2023
1 parent 2e5e476 commit b4bf24c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/godoo_cli/commands/rpc/translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def dump_translations(
addon_path = workspace_addon_path
addon_folders = get_odoo_module_paths(addon_path)
valid_module_names = [str(p.stem) for p in addon_folders]
LOGGER.debug("Found modules:\n%s", "\n".join(["\t" + mn for mn in valid_module_names]))
LOGGER.debug("Found modules:\n%s", valid_module_names)

odoo_api = wait_for_odoo(
odoo_host=rpc_host,
Expand Down
4 changes: 2 additions & 2 deletions src/godoo_cli/commands/source_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def unpack_addon_archives(
continue
LOGGER.debug(
"Found modules in Zipfile:\n%s",
"\n".join([str(f.relative_to(td)) for f in zip_module_paths]),
[str(f.relative_to(td)) for f in zip_module_paths],
)
target_folder = target_addon_folder / ("single_mods" if len(zip_module_paths) == 1 else zip_file.stem)
target_folder.mkdir(exist_ok=True)
Expand Down Expand Up @@ -124,7 +124,7 @@ def py_depends_by_db(
raise typer.Exit(1) from e
module_list = [r[0] for r in conn.fetchall()]
LOGGER.info("Ensuring Py Reqiurements for Installed Modules are met")
LOGGER.debug("Modules:\n%s", "\n".join(["\t" + m for m in module_list]))
LOGGER.debug("Modules:\n%s", module_list)
odoo_addon_paths = get_addon_paths(
odoo_main_repo=odoo_main_path,
workspace_addon_path=workspace_addon_path,
Expand Down
2 changes: 1 addition & 1 deletion src/godoo_cli/commands/test/test_load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def odoo_load_test_data(

module_list_csv = ",".join(test_modules)

LOGGER.info("Installing Test data for Odoo Modules:\n%s", "\n".join(sorted(["\t" + m for m in test_modules])))
LOGGER.info("Installing Test data for Odoo Modules:\n%s", sorted(test_modules))

bootstrap_args = [
f"--init {module_list_csv}",
Expand Down
4 changes: 2 additions & 2 deletions src/godoo_cli/commands/test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def odoo_run_tests(
m for m in skip_test_modules if m in test_modules
] # Filter out skip mods that arent requested
if skip_test_modules:
LOGGER.info("Skipping Tests for Modules:\n%s", ", ".join(["\t" + m for m in skip_test_modules]))
LOGGER.info("Skipping Tests for Modules:\n%s", skip_test_modules)
test_modules = [m for m in test_modules if m not in skip_test_modules]

if not test_modules:
Expand All @@ -85,7 +85,7 @@ def odoo_run_tests(
test_module_list = ",".join(["/" + m for m in test_modules])
module_list = ",".join(test_modules)

LOGGER.info("Testing Odoo Modules:\n%s", "\n".join(sorted(["\t" + m for m in test_modules])))
LOGGER.info("Testing Odoo Modules:\n%s", sorted(test_modules))

bootstrap_args = [
f"--init {module_list}",
Expand Down
7 changes: 4 additions & 3 deletions src/godoo_cli/helpers/odoo_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def get_changed_modules(
LOGGER.debug(
"Found Modules changed to branch '%s':\n %s",
diff_branch,
"\n".join(["\t" + str(f) for f in changed_module_folders]),
changed_module_folders,
)
return changed_module_folders

Expand Down Expand Up @@ -262,7 +262,7 @@ def _get_python_requirements_of_modules(addon_paths: List[Path], filter_module_n
LOGGER.debug("Checking python requirements of Modules: %s", sorted(filter_module_names))
if unavailable_modules := set(filter_module_names).difference(available_module_names):
LOGGER.warning("Could not find __manifest__ for: %s", unavailable_modules)
LOGGER.debug("Search Paths:\n%s", "\n".join(map(str, addon_paths)))
LOGGER.debug("Search Paths:\n%s", map(str, addon_paths))

check_modules = [mp for mp in available_modules if mp.stem in filter_module_names]

Expand All @@ -277,9 +277,10 @@ def _get_python_requirements_of_modules(addon_paths: List[Path], filter_module_n
check_modules_dependencies += get_depends_of_module(
available_modules, module, already_done_modules=check_modules_dependencies
)
check_modules_dependencies = list(set(check_modules_dependencies))
LOGGER.debug(
"adding children of requested modules to check list:\n%s",
"\n".join(sorted([p.stem for p in check_modules_dependencies])),
sorted([p.stem for p in check_modules_dependencies]),
)

check_modules += check_modules_dependencies
Expand Down

0 comments on commit b4bf24c

Please sign in to comment.