[IMP] developer/*: clarify --test-tags
Corresponding PRs to odoo/odoo: https://github.com/odoo/odoo/pull/71130 https://github.com/odoo/odoo/pull/71331 --- task-2431630
This commit is contained in:
parent
5469c2fb2c
commit
8b201ca924
@ -42,19 +42,25 @@ Before knowing how to write tests, we need to know how to run them.
|
|||||||
Launch a python test file.
|
Launch a python test file.
|
||||||
--test-enable Enable unit tests.
|
--test-enable Enable unit tests.
|
||||||
--test-tags=TEST_TAGS
|
--test-tags=TEST_TAGS
|
||||||
Comma-separated list of spec to filter which tests to
|
Comma-separated list of specs to filter which tests to
|
||||||
execute. Enable unit tests if set.
|
execute. Enable unit tests if set. A filter spec has
|
||||||
A filter spec has the format:
|
the format: [-][tag][/module][:class][.method] The '-'
|
||||||
[-][tag][/module][:class][.method]
|
specifies if we want to include or exclude tests
|
||||||
The '-' specifies if we want to include or exclude
|
matching this spec. The tag will match tags added on a
|
||||||
tests matching this spec. The
|
class with a @tagged decorator (all Test classes have
|
||||||
tag will match tags added on a class with a @tagged
|
'standard' and 'at_install' tags until explicitly
|
||||||
decorator. By default tag value is 'standard' when not
|
removed, see the decorator documentation). '*' will
|
||||||
given on include mode. '*' will match all tags. Tag
|
match all tags. If tag is omitted on include mode, its
|
||||||
will also match module name (deprecated, use /module)
|
value is 'standard'. If tag is omitted on exclude
|
||||||
The module, class, and method will respectively match
|
mode, its value is '*'. The module, class, and method
|
||||||
the module name, test class name and test method name.
|
will respectively match the module name, test class
|
||||||
examples: :TestClass.test_func,/test_module,external
|
name and test method name. Example: --test-tags
|
||||||
|
:TestClass.test_func,/test_module,external Filtering
|
||||||
|
and executing the tests happens twice: right after
|
||||||
|
each module installation/update and at the end of the
|
||||||
|
modules loading. At each stage tests are filtered by
|
||||||
|
--test-tags specs and additionally by dynamic specs
|
||||||
|
'at_install' and 'post_install' correspondingly.
|
||||||
--screencasts=DIR Screencasts will go in DIR/{db_name}/screencasts.
|
--screencasts=DIR Screencasts will go in DIR/{db_name}/screencasts.
|
||||||
--screenshots=DIR Screenshots will go in DIR/{db_name}/screenshots.
|
--screenshots=DIR Screenshots will go in DIR/{db_name}/screenshots.
|
||||||
Defaults to /tmp/odoo_tests.
|
Defaults to /tmp/odoo_tests.
|
||||||
|
@ -54,11 +54,28 @@ Running the server
|
|||||||
|
|
||||||
.. option:: --test-enable
|
.. option:: --test-enable
|
||||||
|
|
||||||
runs tests after installing modules
|
runs tests after module installation
|
||||||
|
|
||||||
.. option:: --test-tags 'tag_1,tag_2,...,-tag_n'
|
.. option:: --test-tags [-][tag][/module][:class][.method]
|
||||||
|
|
||||||
select the tests to run by using tags.
|
Comma-separated list of specs to filter which tests to execute. Enable unit tests if set.
|
||||||
|
|
||||||
|
Example: `--test-tags :TestClass.test_func,/test_module,external`
|
||||||
|
|
||||||
|
* The `-` specifies if we want to include or exclude tests matching this spec.
|
||||||
|
* The tag will match tags added on a class with a :func:`~odoo.tests.common.tagged` decorator
|
||||||
|
(all :ref:`test classes <reference/testing>` have `standard` and `at_install` tags
|
||||||
|
until explicitly removed, see the decorator documentation).
|
||||||
|
* `*` will match all tags.
|
||||||
|
* If tag is omitted on include mode, its value is `standard`.
|
||||||
|
* If tag is omitted on exclude mode, its value is `*`.
|
||||||
|
* The module, class, and method will respectively match the module name, test class name and test method name.
|
||||||
|
|
||||||
|
Filtering and executing the tests happens twice: right
|
||||||
|
after each module installation/update and at the end
|
||||||
|
of the modules loading. At each stage tests are filtered
|
||||||
|
by `--test-tags` specs and additionally by dynamic specs
|
||||||
|
`at_install` and `post_install` correspondingly.
|
||||||
|
|
||||||
.. option:: --screenshots
|
.. option:: --screenshots
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user