Ces 382 tests ne tournaient que lancés à la main, donc jamais. « make test » demande une base de données et plusieurs minutes ; ceux-ci lisent le code et exécutent les fragments de shell générés, sudo, pgrep et pkill bouchonnés, en une dizaine de secondes. Deux cibles : test_unit, et test_unit_file pour la boucle d'écriture. La dépendance à mobile/erplibre_home_mobile est DITE plutôt que supposée : le lanceur l'annonce présente ou absente, et les tests du vrai transfert se déclarent ignorés — avec la commande qui manque — au lieu de passer en silence. Vérifié dans les trois états : dépôt absent, présent non compilé, compilé. Au passage, compile_and_run.sh vérifie le transfert des dépôts, comme l'installation d'une VM et par le même script. --- EN --- These 382 tests only ran when invoked by hand, so never. "make test" wants a database and several minutes; these read the code and run the generated shell fragments with sudo, pgrep and pkill stubbed, in about ten seconds. Two targets: test_unit, and test_unit_file for the writing loop. The dependency on mobile/erplibre_home_mobile is STATED rather than assumed: the runner announces it present or absent, and the real-transfer tests declare themselves skipped — naming the missing command — instead of passing quietly. Checked in all three states: repo absent, present but unbuilt, built. Along the way, compile_and_run.sh verifies the repo transfer, like a VM install and through the same script. Assisted-by: Claude Opus 5
152 lines
6.2 KiB
Makefile
152 lines
6.2 KiB
Makefile
########
|
|
# TEST #
|
|
########
|
|
|
|
# TODO load specific test file : ./run.sh -d test_file --log-level=test --test-enable --stop-after-init --test-file ./.venv.erplibre/test.py
|
|
|
|
###########################
|
|
# Tests unitaires python #
|
|
###########################
|
|
# Ni base de données, ni Odoo, ni VM : ils lisent le code et exécutent les
|
|
# fragments de shell que todo.py génère, « sudo », « pgrep » et « pkill »
|
|
# bouchonnés. Une dizaine de secondes, là où « make test » demande une base et
|
|
# plusieurs minutes — d'où une cible à part, faite pour être lancée souvent.
|
|
#
|
|
# DÉPENDANCE : les tests du transfert mobile lisent
|
|
# mobile/erplibre_home_mobile. Le lanceur l'annonce présent ou absent avant de
|
|
# commencer, et les tests concernés se déclarent ignorés plutôt que de passer
|
|
# en silence — un test vert sans son dépôt ne prouve rien.
|
|
#
|
|
# « test_todo.py » n'en fait PAS partie : il demande une base de données. Son
|
|
# nom sans souligné le laisse hors du motif, et c'est voulu.
|
|
.PHONY: test_unit
|
|
test_unit:
|
|
./script/test/run_unit_test.sh
|
|
|
|
# Un seul fichier, pour la boucle d'écriture :
|
|
# make test_unit_file F=test/test_qemu_forgejo.py
|
|
.PHONY: test_unit_file
|
|
test_unit_file:
|
|
./script/test/run_unit_test.sh $(F)
|
|
|
|
.PHONY: open_test_coverage
|
|
open_test_coverage:
|
|
-$(BROWSER) htmlcov/index.html
|
|
|
|
.PHONY: test
|
|
test:
|
|
./script/make.sh clean
|
|
-rm ${LOG_FILE}
|
|
./script/make.sh test_base |& tee -a ${LOG_FILE}
|
|
./script/test/check_result_test.sh ${LOG_FILE}
|
|
|
|
.PHONY: test_full
|
|
test_full:
|
|
./script/make.sh clean
|
|
-rm ${LOG_FILE}
|
|
./script/make.sh test_base |& tee -a ${LOG_FILE}
|
|
./script/make.sh test_extra |& tee -a ${LOG_FILE}
|
|
#./script/make.sh doc |& tee -a ${LOG_FILE}
|
|
./script/test/check_result_test.sh ${LOG_FILE}
|
|
|
|
.PHONY: test_full_fast
|
|
test_full_fast:
|
|
./script/make.sh clean
|
|
# Need to create a BD to create cache _cache_erplibre_base
|
|
./script/database/db_restore.py --database test
|
|
#./script/test/run_parallel_test.py --keep_cache
|
|
./script/test/run_parallel_test.py
|
|
# TODO This test is broken in parallel
|
|
#./script/make.sh test_code_generator_hello_world
|
|
|
|
.PHONY: test_full_fast_debug
|
|
test_full_fast_debug:
|
|
./script/make.sh clean
|
|
# Need to create a BD to create cache _cache_erplibre_base
|
|
./script/database/db_restore.py --database test
|
|
./script/test/run_parallel_test.py --keep_cache
|
|
# TODO This test is broken in parallel
|
|
#./script/make.sh test_code_generator_hello_world
|
|
|
|
.PHONY: test_full_fast_coverage
|
|
test_full_fast_coverage:
|
|
./script/make.sh clean
|
|
# Need to create a BD to create cache _cache_erplibre_base
|
|
./script/database/db_restore.py --database test
|
|
./.venv.erplibre/bin/coverage erase
|
|
./script/test/run_parallel_test.py --coverage
|
|
# TODO This test is broken in parallel
|
|
#./script/make.sh test_coverage_code_generator_hello_world
|
|
./.venv.erplibre/bin/coverage combine -a
|
|
./.venv.erplibre/bin/coverage report -m --include="./odoo$(ODOO_VERSION)/addons/TechnoLibre_odoo-code-generator/*"
|
|
./.venv.erplibre/bin/coverage html --include="./odoo$(ODOO_VERSION)/addons/TechnoLibre_odoo-code-generator/*"
|
|
./.venv.erplibre/bin/coverage json --include="./odoo$(ODOO_VERSION)/addons/TechnoLibre_odoo-code-generator/*"
|
|
# run: make open_test_coverage
|
|
|
|
|
|
.PHONY: test_cg_demo
|
|
test_cg_demo:
|
|
./script/make.sh clean
|
|
# Need to create a BD to create cache _cache_erplibre_base
|
|
./script/database/db_restore.py --database test
|
|
./.venv.erplibre/bin/coverage erase
|
|
./script/addons/coverage_install_addons_dev.sh test code_generator_demo
|
|
./.venv.erplibre/bin/coverage combine -a
|
|
./.venv.erplibre/bin/coverage report -m --include="./odoo$(ODOO_VERSION)/addons/TechnoLibre_odoo-code-generator/*"
|
|
./.venv.erplibre/bin/coverage html --include="./odoo$(ODOO_VERSION)/addons/TechnoLibre_odoo-code-generator/*"
|
|
./.venv.erplibre/bin/coverage json --include="./odoo$(ODOO_VERSION)/addons/TechnoLibre_odoo-code-generator/*"
|
|
|
|
.PHONY: test_base
|
|
test_base:
|
|
./script/make.sh test_format
|
|
./script/make.sh test_code_generator_hello_world
|
|
./script/make.sh test_installation_demo
|
|
./script/make.sh test_code_generator_generation
|
|
./script/make.sh test_code_generator_generation_template
|
|
|
|
.PHONY: test_extra
|
|
test_extra:
|
|
./script/make.sh test_code_generator_migrator_demo_mariadb_sql_example_1
|
|
./script/make.sh test_code_generator_template_demo_mariadb_sql_example_1
|
|
./script/make.sh test_code_generator_demo_mariadb_sql_example_1
|
|
|
|
.PHONY: test_format
|
|
test_format:
|
|
./script/maintenance/black.sh --check ./odoo$(ODOO_VERSION)/addons/TechnoLibre_odoo-code-generator/
|
|
./script/maintenance/black.sh --check ./odoo$(ODOO_VERSION)/addons/TechnoLibre_odoo-code-generator-template/
|
|
|
|
.PHONY: test_installation_demo
|
|
test_installation_demo:
|
|
./script/code_generator/check_git_change_code_generator.sh ./odoo$(ODOO_VERSION)/addons/TechnoLibre_odoo-code-generator-template
|
|
./script/database/db_restore.py --database test_demo
|
|
./script/addons/install_addons.sh test_demo demo_helpdesk_data,demo_internal,demo_internal_inherit,demo_mariadb_sql_example_1,demo_portal,demo_website_data,demo_website_leaflet,demo_website_snippet
|
|
./script/addons/install_addons_theme.sh test_demo theme_website_demo_code_generator
|
|
|
|
###############
|
|
# Test addons #
|
|
###############
|
|
.PHONY: test_addons_sale
|
|
test_addons_sale:
|
|
./.venv.erplibre/bin/coverage erase
|
|
./odoo_bin.sh db --drop --database test_addons_sale
|
|
./test.sh -d test_addons_sale --db-filter test_addons_sale -i sale
|
|
./.venv.erplibre/bin/coverage combine -a
|
|
./.venv.erplibre/bin/coverage report -m
|
|
./.venv.erplibre/bin/coverage html
|
|
./.venv.erplibre/bin/coverage json
|
|
|
|
.PHONY: test_addons_helpdesk
|
|
test_addons_helpdesk:
|
|
./.venv.erplibre/bin/coverage erase
|
|
./odoo_bin.sh db --drop --database test_addons_helpdesk
|
|
./test.sh -d test_addons_helpdesk --db-filter test_addons_helpdesk -i helpdesk_mgmt
|
|
./.venv.erplibre/bin/coverage combine -a
|
|
./.venv.erplibre/bin/coverage report -m
|
|
./.venv.erplibre/bin/coverage html
|
|
./.venv.erplibre/bin/coverage json
|
|
|
|
.PHONY: test_addons_project_sale_link_specific_file
|
|
test_addons_project_sale_link_specific_file:
|
|
./odoo_bin.sh db --drop --database test_addons_project_sale_link
|
|
./script/addons/install_addons_dev.sh test_addons_project_sale_link project_sale_link
|
|
./test.sh -d test_addons_project_sale_link --db-filter test_addons_project_sale_link -i project_sale_link --test-file=odoo18.0/addons/OCA_project/project_sale_link/tests/test_project_sale_link.py
|