Skip to content

feat: run installed module dependency tests#174

Open
pilipilisbot wants to merge 3 commits into
masterfrom
feature/installed-modules-tests
Open

feat: run installed module dependency tests#174
pilipilisbot wants to merge 3 commits into
masterfrom
feature/installed-modules-tests

Conversation

@pilipilisbot
Copy link
Copy Markdown
Contributor

@pilipilisbot pilipilisbot commented Apr 30, 2026

Resumen

  • Añade el parámetro --all-installed-tests al CLI de Destral.
  • Con -m <modulo> --all-installed-tests, Destral instala primero el módulo indicado y después ejecuta los tests de toda su cadena de dependencias en orden, de base hasta el módulo objetivo.
  • Reutiliza la misma base de datos ya instalada para ejecutar los tests de los módulos de la cadena, evitando reinstalar módulo a módulo durante la fase de test.
  • Añade un helper para expandir módulos + dependencias y tests unitarios de orden/deduplicación.
  • Documenta el nuevo parámetro en el README.

Validación

  • git diff --check
  • /home/openclaw/.pyenv/versions/erp2/bin/python -m unittest discover tests

@pilipilisbot pilipilisbot self-assigned this Apr 30, 2026
@pilipilisbot pilipilisbot requested a review from ecarreras April 30, 2026 04:47
Co-authored-by: Eduard Carreras <ecarreras@gisce.net>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a CLI mode to run tests for an addon’s full dependency chain by first installing the selected addon(s), plus a utility helper to expand modules with dependencies (with unit tests) and README documentation for the new flag.

Changes:

  • Add --all-installed-tests CLI flag to pre-install selected modules and then run tests for the full dependency chain (base → target).
  • Introduce utils.get_modules_and_dependencies() helper to expand + dedupe modules and dependencies, returning them in dependency order.
  • Add unit tests for dependency expansion/deduplication and document the new CLI option in README.rst.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
destral/cli.py Adds the new CLI flag and logic to install selected modules before testing the expanded dependency chain.
destral/utils.py Exports and implements get_modules_and_dependencies() to expand requested modules with their dependencies.
tests/test_utils.py Adds unit tests validating dependency expansion order and deduplication.
README.rst Documents the new --all-installed-tests option behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread destral/utils.py
Comment thread destral/cli.py
Co-authored-by: Eduard Carreras <ecarreras@gisce.net>
@pilipilisbot
Copy link
Copy Markdown
Contributor Author

He revisat els 2 comentaris de Copilot i he aplicat correcció real al PR.

Commit pujat: c3c1401

Canvis:

  • destral/utils.py: get_dependencies() ja no fa list(set(...)); ara preserva ordre determinista i retorna dependències en ordre dependency-first.
  • tests/test_utils.py: afegit test específic per validar l'ordre retornat per get_dependencies().
  • destral/cli.py: el flag de Click queda alineat explícitament amb installed_modules_tests i accepta també l'àlies --installed-modules-tests.
  • README.rst: documentat l'àlies.

Validació local:

  • Python 3.11 / erp3: python -m unittest discover tests → OK, 14 tests
  • Python 2.7 / erp2: python -m unittest discover tests → OK, 14 tests
  • git diff --check → OK

CI GitHub del commit nou:

  • tests-py311 → OK
  • tests-py27 → OK

He marcat els dos review threads com a resolts.

Únic bloqueig local menor: mamba spec no el puc executar aquí perquè falta doublex_expects a l'entorn erp3; no afecta el CI, que ja ha passat verd.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread destral/cli.py
Comment thread destral/cli.py
Skip per-suite module installs when the database was already provisioned for installed module tests.

Install requirement files once per expanded module to avoid repeated dependency requirement installs.

Co-authored-by: Eduard Carreras <ecarreras@gisce.net>
@pilipilisbot
Copy link
Copy Markdown
Contributor Author

He revisat la nova review de Copilot i he aplicat correcció real al PR.

Commit pujat: c9cf599

Canvis:

  • OOTestSuite té ara skip_module_install; en mode --all-installed-tests s'evita reinstal·lar cada mòdul dins del loop de tests quan la BBDD ja està pre-provisionada.
  • El pre-provisioning continua instal·lant els mòduls seleccionats amb with_test_depends=True, però els tests dels mòduls/dependències ja no forcen install_module() i reinicis de pool per cada suite.
  • install_requirements() accepta include_dependencies; el mode per BBDD preinstal·lada expandeix i deduplica mòduls una sola vegada i després instal·la requirements per mòdul sense tornar a expandir dependències cada cop.
  • Afegits tests unitaris per validar que install_requirements(..., include_dependencies=False) no reinstal·la requirements de dependències, mantenint el comportament per defecte intacte.

Validació local:

  • Python 3.11.15: python -m unittest discover tests → OK, 16 tests
  • Python 2.7.18: python -m unittest discover tests → OK, 16 tests
  • git diff --check → OK

He resolt els dos review threads nous de Copilot.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants