summaryrefslogtreecommitdiff
path: root/addons/web/tests/test_serving_base.py
AgeCommit message (Collapse)Author
2020-10-02[FIX] web: add margin on template linearity checkXavier-Do
Linearity is not always perfect, managing more template will sometimes lead to slighlty more than a linear ratio randomly. The maximum observed ratio was 10.9. 12 seems a good value to catch non linear treatment while avoiding false positive. closes odoo/odoo#59021 X-original-commit: 62610f7851f0994fc0864f2b95851ce8b5984ce7 Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2020-03-16[IMP] core: improve module loading logsXavier-Do
Performances from a general point of view can be difficult to track. This commit proposes to improve logs in two ways: The current logs only use the sql_counter, wich will only be updated when a cursor is closed. In a test-enable install, this counter is actually the queries of the tests wince the install cursor is open untill the end. The first fix is to use bot sql_counter and sql_log_count to have total queries untill now on closed cursor, but also the current number of queries of the current cursor. This means that the new log format will be {nb} modules loaded in {time}, {loading_querie} (+{test_cr_queries}) queries instead of {nb} modules loaded in {time}, {tests_cr__queries}queries Nothe that in the current version, {nb} is actually the total number of loaded modules until now. This commit also add an equivalent end log by module and change the loglevel of module start on install (mainly usefull if an error occurs before anything else is logged hidding the module causing this error.) A cleaner runbot logger is also added, in order to be abble to call _logger.runbot( instead of _logger.log(25. This will clarify the purpose of such a log level. closes odoo/odoo#47283 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-01-30[FIX] web: template inheritance from dotted nameLucas Perais (lpe)
A good practice is to always prefix the name of a template by the name of the module it is defined in. So in the case where a template ```xml <t t-name="module.template" /> ``` was inherited by another Before this commit, one should have written ```xml <t t-name="other" t-inherit="module.module.template" /> ``` After this commit, it becomes more natural, and one should only write ```xml <t t-name="other" t-inherit="module.template"/> ```
2020-01-13[FIX] web: static inheritance testingLucas Perais (lpe)
Before this commit, there were some tests checking how long it took to compute a bunch of templates Those asserted a time limit, which is undeterministic After this commit, those performance tests are not executed as standard anymore Moreover, only asserts on ratios between computations is done and deemed relevant. closes odoo/odoo#43189 X-original-commit: 329fdf3961ea9e6eddbcba7a78d72102d2d08ac1 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-12-04[IMP] web: static inheritance: primary root node is the master nodeLucas Perais (lpe)
Before this commit, when doing a primary inheritance the root node of the resulting template was the one of the inherited template after this commit, the root node of the resulting template is the one defined on the inheriting template closes odoo/odoo#39452 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-12-04[IMP]: web, tools: static inheritance do not disclose t-inherit* directivesLucas Perais (lpe)
Before this commit, when a template was inheriting from another the template mentionned its t-inherit This has been deemed overkill as the information is irrelevant to the caller i.e. the caller just wants the template and doesn't care how they've been computed After this commit, only t-name and attributes not related with inheritance are disclosed [FIX]: base: static inheritance propagates other attributes When doing a inherit in primary mode, the original attributes on the root node of the inheriting template were not propagated After this commit they are
2019-12-04[IMP] web: template inheritance respects XPATH specsLucas Perais (lpe)
At the conception of this feature it has been intentionally thought that the behavior for static templates should resemble what is done for ir.ui.view While keeping the general previous behavior (and this is important) A little bit of context for ir.ui.view They are defined as XML's, but end up as python objects Their meta-data (id, name, inheritance specs...) are thus present in their XML definition, but end up as part of python objects members Hence, the final, business, usable arch is free of those meta-data and is left only with business-relevant dom nodes The static inheritance feature was backed with those ideas but inherently encountered the issue that, for them, the meta-data also end up in the business dom, since they are at no point considered as plain objects. Decision has been made, back then, to exclude the root node that holds the metadata, to be at all targeted by any XPATH This decision is now challenged as the specs of XPATH should be respected This commit consequently introduces the root node as any other It can be replaced, and will be targeted by `expr="."` or `expr="//NODE_TAG"` The few attributes that are necessary to define them are kept across inheritance cycles though.
2019-10-28[FIX] web, tools: static inheritance supports replace in debug modeLucas Perais (lpe)
Have a parent template Have a child, in extension inherit mode of the parent The child has a xpath like `<xpath expr="." position="replace" />` Before this commit, there was a crash. That was because the Comment (which indicates which templates modified the parent) was taken as the replacer node instead of the actual content of the xpath After this commit, there is no crash, and it works as expected closes odoo/odoo#39453 X-original-commit: 02d790e1d21b78395e489f57bf30c82f728cbee6 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-10-24[FIX] web: use BaseCase instead of TestCase after saas-12.5Xavier-Do
closes odoo/odoo#39329 X-original-commit: e2d7cf7898704c82f25556b0b0edb87c05ec5903 Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-07-24[IMP] base, web: static xml templates support serverside inheritanceLucas Perais (lpe)
QWeb templates that show up in the 'qweb' key of a module's manifest now support server side inheritance and xpath evaluation QWeb templates that show up in the xmlDependencies of a JS widget are not impacted at all by theses changes, as they are served through the Werkzeug sharedMiddleware A similar syntax than ir.ui.view has been implemented in the QWeb templates - each template must have a root node, whatever tag works - the root node of a template must have a t-name containing the name of the template The name -- without the module's name -- may contain dots pretty much anywhere Though what is recommended is only underscores in template names - if a template is to inherit from a parent, the root node has a t-inherit directive containing either the full name of the template it inherits from which is module_name.template_name or the name of the template, no module name necessary, if the parent template is in the same module - there are 2 modes of inheriting primary: copy the behavior of the parent into the template extension: modifies the parent in place Task: 1999528 closes odoo/odoo#33892 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com> Co-authored-by: Julien Mougenot <jum@odoo.com> Co-authored-by: Lucas Perais <lpe@odoo.com>
2019-07-11[IMP] core: improve test_tagsXavier-Do
Add the support to be able to specify exlicitely module, class and method name in test_tags Before this commit, there is no distinction between module tag and test tag. Meaning that --test-tag module_name will replace the default +standard tag and execute all test of the module. This commit tries to keep the initial behaviour, while addind new features, like explicit modules tag with /module_name, as well as class (:class) and method (.method) Some usage examples: --test_tags /module will execute all standard test of module --test_tags :class will execute all standard test with class name 'class' --test_tags .method will execute all standard test with method name 'method' --test_tags external/module will execute all external test of module --test_tags */module will execute all tests of module, --test_tags */module,-standard will execute all non standard tests of module, --test_tags -/website:TestUiTranslate.test_admin_tour_rte_translator will disable only rte translator test closes odoo/odoo#34756 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2018-01-19[FIX] web,website,tests: fix typo in test tagsChristophe Monniez
This typo prevented two tests to run.
2018-01-18[IMP] tests: Add the possibility to tag testsChristophe Monniez
Purpose: When running tests, all the tests for the installed/updated files are done. This commit adds a 'tagged' decorator that can be used to tag tests. Combined with a new 'test-tags' CLI option, it adds the ability to filter which tests are executed. For example, @tagged('slow') will add a tag 'slow' to the test. The CLI option 'test-tags="slow"' will only run tests tagged 'slow'. One can use prefixes to select cases with tags. '+' or no prefix means that the tests tagged with this tag are selected for execution. '-' prefix will exclude the tests tagged with this tag. Exclusion takes precedence over inclusion. Also, by default, all Odoo tests cases are tagged 'standard' and with the technical name of the module. This means that when selecting tests with the 'test-tags' parameter, if '-standard' is not specified, all tests tags are going to be executed. When tagging tests, one can remove such automatic tag by prefixing the tag name with '-'. E.g. @tagged('-standard') will remove the standard tag from the test. Another example, if one wants to test the 'sale' module alone, even without adding any 'tagged' decorator thos tests can be selected like that: --test-tags="sale" Tests are selected or deselected using a TagsSelector. When instanciated, a string is passed with comma separated tests selectors like '+slow,-standard'. When the 'check' method is called with a test as argument, it returns True or False if the test has to be executed or not.
2017-05-10[FIX] P3: list -> iterable builtins (#16811)xmo-odoo
In Python 3: * various builtins and dict methods were changed to return view/iterable objects rather than lists * and the separate Python 2 view/iterable builtins and methods were removed altogether This is problematic when using these items as list (which the happens repeatedly in Odoo), but more viciously when iterating *multiple times* over them (which also happens, which I've messed up multiple times while writing this, and which is a pain to debug even when you've just created the issue). Convert all code using these to semantics-matching cross-version helper functions to get the LCD behaviour between P2 and P3, and forbid the builtins via lint. issue #8530
2016-08-03[IMP] web: remove void file, replace openerp tags, add license, clean importsfwi-odoo
2015-09-28[IMP] unittest2 > unittestLeonardo Rochael Almeida
The `unittest2` package is simply a backport of `unittest` from the Standard Library of Python 2.7 to previous versions. There is no reason to use it any longer. Closes #6941
2014-08-08[IMP] refactoring: move function topological_sort to openerp.toolsRaphael Collet
2012-09-10[FIX] integrate web tests into buildbot runner, fix broken testsXavier Morel
* Remove deprecated tests and dead code * Fix usage of mock * Moar fixes bzr revid: xmo@openerp.com-20120910105129-rxh3jqwkewh65rl3