Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

9

How to run tests

By
Daniel Reis
on 2/8/13, 12:35 PM 9,926 views

What is the command to start a server instance and run the test suite?

Where can I check the results afterwards?

This question has been included in the official documentation.
9

Fabien Pinckaers (fp)

--Fabien Pinckaers (fp)--
6598
| 6 8 8
fsdsdfsdf, Belgium
--Fabien Pinckaers (fp)--

Odoo Founder & CEO

Fabien Pinckaers (fp)
On 2/8/13, 2:59 PM

Tests are launched when you install or update modules. If you want to launch the tests of the sale module and all it's dependencies, you have to create a demo database and

./openerp-server --addons-path=... -d mydb --log-level=test -i sale --test-enable

The argument --log-level=test is not required, but if you omit it, you will not see the logs of all tests that are executed.

Optionally, you can add:

--test-report-directory=/tmp

If you develop on the sale module, you can run the server with the same argumentsn but with -u instead of -i (and avoid the createdb command) so that it relaunches only the tests of the sale module.

About '--log-level=test', 'openerp-server --help' says '--log-level=LOG_LEVEL specify the level of the logging. Accepted values: ['info', 'debug_rpc', 'warn', 'test', 'critical', 'debug_sql', 'error', 'debug', 'debug_rpc_answer', 'notset'] (deprecated option).' What should I use to enable test logging?

eLBati
on 3/14/13, 7:07 AM

In order to complete the answer, I would add that tests are run on demo databases only

eLBati
on 3/14/13, 7:40 AM

There is no longer a TEST logging level. Instead a dedicated logger named openerp.tests is used (normally at the INFO level). --log-level is deprecated in favor of the more general --log-handler.

Vo Minh Thu
on 4/9/13, 5:48 AM

in v7.0 any way to just run unittest ?

Cristian Salamea
on 6/8/14, 5:57 PM
This question has been included in the official documentation.
1

Naresh Soni (nch)

--Naresh Soni (nch)--
Tiny ERP Pvt Ltd
http://www.odoo.com
1281
| 2 2 4
India
--Naresh Soni (nch)--

Team Lead, Odoo(Formerly OpenERP) Support & OPW

Naresh Soni (nch)
On 2/8/13, 1:43 PM

Hello,

You need to first enter to the path where your server resides and use the following command. for eg:

naresh@naresh:~/server$ ./openerp-server --addons-path=../addons,../web/addons/

For running tests you can use from this options when you start your server.

Testing Configuration:

 --test-file=TEST_FILE

        Launch a YML test file.

--test-report-directory=TEST_REPORT_DIRECTORY

                    If set, will save sample of all reports in this
                    directory.

--test-enable       Enable YAML and unit tests.

--test-commit       Commit database changes performed by YAML or XML
                    tests.

Thanks,

I guess the option for what I need --test-enable. Unfortunately that didn't work, the server started normally only logging INFO and WARNING messages.

Daniel Reis
on 2/8/13, 2:00 PM

hi All, please give me some advice..

I have been trying to test the YAML test on openerp 6.0.4... ubuntu 11.04 server..

@Naresh Soni : "naresh@naresh:~/server$ ./openerp-server --addons-path=../addons,../web/addons/"

i was confused about that.. when i want to access the addons, i typed on my ubun

Anthony Huang
on 2/17/13, 2:45 AM

This naresh@naresh:~/server$ ./openerp-server --addons-path=../addons,../web/addons/ is just an example to show you . in your case you need to first travel to the directory where your openerp server resides., then type ./openerp-server --addons-path=PATH TO YOUR ADDONS DIRECTORY

Naresh Soni (nch)
on 2/19/13, 8:47 AM
This question has been included in the official documentation.
1
Anthony Huang
On 2/17/13, 2:42 AM

hi All, please give me some advice..

I have been trying to test the YAML test on openerp 6.0.4... ubuntu 11.04 server..

@Naresh Soni : "naresh@naresh:~/server$ ./openerp-server --addons-path=../addons,../web/addons/"

i was confused about that.. when i want to access the addons, i typed on my ubuntu server like this : /opt/openerp/server/bin/addons

I stuck on the command which used to test the YAML..

Please Help

Thank You Sir

This question has been included in the official documentation.
0
Antonio M. Vigliotti
On 5/26/14, 11:23 AM

Hi Allbodies,

I cannot see test execution.

I submitted follow command

./lp/openerp/openerp-server --log-level=test -u base --test-enable --test-report-directory=./testlog -d mydb

I do not see anything in log file.

I do no see nothing in ./testlog directory

What do I wrong?

Thanka

 

Antonio Maria Vigliotti

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 2/8/13, 12:35 PM
Seen: 9926 times
Last updated: 9/4/15, 2:44 PM