diff --git a/.claude/rules/03-commands.md b/.claude/rules/03-commands.md index 06dd2ae..d6c2d24 100644 --- a/.claude/rules/03-commands.md +++ b/.claude/rules/03-commands.md @@ -2,9 +2,9 @@ ## Changement de version Odoo ```bash -make switch_odoo_18 # Passer à Odoo 18 +make switch_odoo_18 # Passer à Odoo 18 (défaut) make switch_odoo_17 # Passer à Odoo 17 -make switch_odoo_16 # Passer à Odoo 16 (défaut) +make switch_odoo_16 # Passer à Odoo 16 make switch_odoo_15 # Passer à Odoo 15 make switch_odoo_14 # Passer à Odoo 14 make switch_odoo_13 # Passer à Odoo 13 @@ -30,12 +30,38 @@ make db_clone_test_to_test2 # Cloner test -> test2 ``` ## Tests +### Suite complète ```bash make test # Tests de base + format make test_full_fast # Tests complets en parallèle make test_full_fast_coverage # Avec couverture de code +make open_test_coverage # Ouvrir le rapport HTML de couverture ``` +### Tester un module spécifique +```bash +# 1. Supprimer la DB de test et lancer les tests du module +./odoo_bin.sh db --drop --database test_mon_module +./test.sh -d test_mon_module --db-filter test_mon_module -i mon_module + +# 2. Lancer un fichier de test précis +./odoo_bin.sh db --drop --database test_mon_module +./script/addons/install_addons_dev.sh test_mon_module mon_module +./test.sh -d test_mon_module --db-filter test_mon_module -i mon_module \ + --test-file=addons/MON_REPO/mon_module/tests/test_mon_fichier.py + +# 3. Avec couverture de code +./.venv.erplibre/bin/coverage erase +./odoo_bin.sh db --drop --database test_mon_module +./test.sh -d test_mon_module --db-filter test_mon_module -i mon_module +./.venv.erplibre/bin/coverage combine -a +./.venv.erplibre/bin/coverage report -m +./.venv.erplibre/bin/coverage html +``` + +> `test.sh` est un alias de `run.sh` avec `ODOO_MODE_TEST=true --workers 0`. + + ## Formatage du code ```bash make format # Fichiers à commiter uniquement @@ -61,3 +87,10 @@ make repo_do_stash # Stash tous les dépôts make install_os # Dépendances système make install_odoo_18 # Installer Odoo 18 complet ``` + +# Tester un seul module Odoo + +./run.sh -d test --log-level=test --test-enable --stop-after-init -i nom_module + +# Tester un fichier de test spécifique +./run.sh -d test --log-level=test --test-enable --stop-after-init --test-file chemin/vers/test.py diff --git a/CLAUDE.md b/CLAUDE.md index 5e5fc65..deb450d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,4 +1,8 @@ -# CLAUDE.md - ERPLibre Multi-Version Odoo Platform +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## ERPLibre Multi-Version Odoo Platform ## Projet