Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Odoo `--test-enable` doesn't work

I'm following Odoo 10 Development Essentials Chapter 2 to develop a simple todo addon. I'm using odoo's docker as my environment.

You can check all my source code (including dockers') at https://github.com/spacegoing/docker_odoo

The problem is I set up my tests/ directory exactly the same as the book's example. However, the test only run once. After the first execution the test was never invoked. There is even no .pyc file in tests directory.

Here are the commands I tried

odoo --db_host db --db_port 5432 -r odoo -w odoo -i todo_app --test-enable --xmlrpc-port=8070 --logfile=/var/log/odoo/odoo_inst1.log

odoo --db_host db --db_port 5432 -r odoo -w odoo -u todo_app --test-enable --xmlrpc-port=8070 --logfile=/var/log/odoo/odoo_inst1.log

Notes:

  1. odoo-bin is odoo in docker
  2. I've installed todo_app with another odoo instance running on port 8069
like image 922
spacegoing Avatar asked Jun 15 '17 14:06

spacegoing


1 Answers

Finally I found the answer. This is the hugest gotcha I've ever met since I'm 5 years old.

No where mentioned in official document that test will only run after you installed the demo database.

I found this from this forum post: https://www.odoo.com/forum/help-1/question/why-my-test-yaml-do-not-run-42123

So if you tried every single command you can find and none of them works, this might be your answer.

like image 115
spacegoing Avatar answered Oct 28 '22 21:10

spacegoing