Commit Graph
77 Commits
Author SHA1 Message Date
Christophe Simonis 87e21ccdc5 [MERGE] forward port branch 11.0 up to 521414b1c1 2018-05-02 19:36:16 +02:00
Manuel Vázquez Acosta 33704bc717 [FIX] web: Explicitly decode the JS files in tests.
When in Python 3, then function `open` defaults to open the file in text mode
with and the encoding (if not passed) is taken from
`locale.getpreferredencoding`.

Using `getpreferredencoding` is not necessarily a good practice.  Because
files might no be encoded that way.

When testing Odoo not in runbot (which has LANG set to C.UTF-8) you may get:

Traceback (most recent call last):
  File "/home/gitlab-runner/src/odoo11/addons/web/tests/test_js.py", line 24, in test_check_suite
    self._check_only_call('web.qunit_suite')
  File "/home/gitlab-runner/src/odoo11/addons/web/tests/test_js.py", line 37, in _check_only_call
    if RE_ONLY.search(fp.read()):
  File "/home/gitlab-runner/virtualenvs/odoo11-MlnlRiTaP2/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4757: ordinal not in range(128)

The proposed solution is to read the file in binary mode, and decode to
unicode/str ourselves using utf-8.  We don't use the encoding argument of
`open`, so that the code works in both Python 3 and Python 2.

PR  #24434
2018-04-26 09:14:29 +02:00
Géry Debongnie 473edda86e [IMP] web: add fail fast feature to qunit test suite
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.

It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.

Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature.  This allows us to increase the global
timeout for the js test suite without fear!
2018-04-12 11:27:15 +02:00
Christophe Monniez 6527b69ee0 [FIX] web: increase timeout of test suite
As the test suite increases, the timeout has to follow until a better
solution is found (like a fail fast in Qunit).
2018-04-11 16:51:43 +02:00
Christophe Simonis a98b46b8f5 [MERGE] forward port branch saas-11.1 up to fa1f2132e7 2018-01-22 18:44:05 +01:00
Christophe Monniez 48b967fde0 [FIX] web,website,tests: fix typo in test tags
This typo prevented two tests to run.
2018-01-19 09:06:09 +01:00
Christophe Monniez b356b19033 [IMP] tests: Add the possibility to tag tests
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.
2018-01-18 13:20:37 +01:00
Nicolas Martinelli 00039883c1 [FIX] web: timeout of test suite
A timeout of 300 seconds is not enough anymore to run all tests on some
runbots (e.g. runbot12) or Odoo.sh installations. The duration on these
servers is often slightly over 300, leading to a failing test.

This increase is logical since unit tests are added on a regular basis.

opw-805418
opw-804621
2018-01-17 11:54:08 +01:00
Christophe Simonis 7a976df0ec [IMP] web: also check for presence of QUnit.only in mobile suite 2017-11-20 16:46:27 +01:00
Aaron Bohy 9bc5009481 [FIX] web(_editor): enable mobile tests
This rev. introduces a new test suite meant to test the webclient
components on mobile devices. The key 'config.device.isMobile' is
forced to true in this test suite, so that mobile specific JS files
are properly executed, which isn't the case in the classic JS test
suite (setting isMobile to true in the test definition is too late,
as the JS files are already processed).

For now, this new test suite contains a single test, which was
skipped until this rev. as it couldn't be executed in the classical
JS test suite.

Both suites are executed at each build of the runbot, and they
can be manually executed from the webclient as well (via the debug
manager).
2017-11-10 10:24:42 +01:00
Christophe Simonis 73bb71b80c [MERGE] forward port branch saas-16 up to 295a377e5d 2017-09-11 18:56:15 +02:00
Christophe Simonis 295a377e5d [IMP] web: add test to ensure nobody will commit again unwanted QUnit.only 2017-09-11 18:14:16 +02:00
Christophe Simonis b8dd34fcbb [MERGE] forward port branch saas-16 up to 64d56995e0 2017-09-06 13:29:05 +02:00
Géry Debongnie fef645fcc5 [FIX] web: increase timeout for js tests
We have a new runbot server which is quite slow.  Because of this, it
takes too much time to run this unit test suite (for comparison, one of
the last build by the main runbot takes 126s).

This is necessary for now, until we use chrome headless or something...
2017-09-05 15:41:26 +02:00
Christophe Simonis feb97a9d7d [FIX] web: bump test timeout 2017-08-25 18:03:14 +02:00
Géry Debongnie 04470b8112 [FIX] web: increase timeout for JS unit tests
Some runbot servers are quite slow in the midday, and they fail the unit
tests because the 3min timeout is reached.
2017-08-24 10:58:27 +02:00
Christophe Simonis e90cd4aa73 [MERGE] forward port branch saas-16 up to 1581d31b3e 2017-07-11 16:28:36 +02:00
Géry Debongnie 50dd6bcd47 [FIX] web: increase timer for js tests
A few builds fail when run in 'primetime', because the js test suite
takes more than 120 seconds (on the slow runbots). With this commit, we
increase our timer to 180s to make sure that this does not happen again.
2017-07-11 14:40:31 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
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
2017-05-10 09:39:55 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Aaron Bohy e950f60fef [FIX] web: increase timeout of test_01_js
This test executes the QUnit js test suite. Since the new views,
this suite keeps growing, which is good. The default timeout
for phantomjs tests is 60 seconds, which starts to be tight for
test_01_js when the runbot is overloaded.

So this commit increases the timeout of this test to 120 seconds.
2017-04-26 12:25:35 +02:00
Aaron Bohy 9b14290b2a [FIX] web: execute WebSuite tests post install
So that tests written in addons are executed as well.
2017-04-11 19:44:38 +02:00
Géry Debongnie 905e01921f [REF] web, *: redesign all JS views
This commit introduce a full redesign of all JS views.  We started
basically from scratch.  The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.

Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented

We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.

Work done by the framework team: mostly aab, ged, chm, dmo, qsm
2017-04-11 19:44:38 +02:00
Christophe Simonis 3bb022d57c [MERGE] forward port branch saas-12 up to 6f8e40c 2016-10-27 18:17:59 +02:00
Christophe Simonis 147db011c7 [FIX] web: deactivate unreliable test 2016-10-27 14:05:16 +02:00
Thibault Delavallée c8a313d51e [IMP] various: use odoo for imports instead of openerp and update class names 2016-08-10 15:48:07 +02:00
fwi-odoo 7d487c00a6 [IMP] web: remove void file, replace openerp tags, add license, clean imports 2016-08-03 13:42:00 +02:00
Leonardo Rochael Almeida 06b3026bcd [IMP] unittest2 > unittest
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
2015-09-28 10:37:27 +02:00
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
Simon Lejeune ee697920f5 [FIX] web: re-enable test_menu.py without the mock-menu test 2014-10-10 18:12:59 +02:00
Raphael Collet 207013c74f [IMP] refactoring: move function topological_sort to openerp.tools 2014-08-08 14:12:06 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Simon Lejeune 195fa93168 [MERGE] backend front end integration
Render the top-menu (backend menu or frontend editbar) server-side.
Use Fontawesome icons (mail, timezone, chat).
Refactor website widgets, split Website.editorBarin editorbar, ace, editorbar- content, editorbarCustomize.
2014-06-27 11:03:34 +02:00
Fabien Meghazi acf2123123 [MERGE] Web assets moved from manifests to ir.ui.view bundles
bzr revid: fme@openerp.com-20140430151302-e42monb4klz4udw5
2014-04-30 17:13:02 +02:00
Richard Mathot (OpenERP) dfe236fe82 [REM] removing menu_di
bzr revid: rim@openerp.com-20140429135640-84ycqhsdlhmdj268
2014-04-29 15:56:40 +02:00
Antony Lesuisse d9eec7345b convert js tests to HttpCase
bzr revid: al@openerp.com-20140428152857-h7z61vdw5crezv2u
2014-04-28 17:28:57 +02:00
Xavier Morel 42763039f0 [IMP] filter out phantomjs warning on OSX
bzr revid: xmo@openerp.com-20140221143512-0qmmxq0gibmdgk6d
2014-02-21 15:35:12 +01:00
Xavier Morel d27526d088 [IMP] JS unit tests
split automated suite so web only runs its own JS tests, and web_tests_demo runs its own.

Also reversed changes to index.

todo: use hack cursor thing?

bzr revid: xmo@openerp.com-20140221124557-s875nj0xrf2t85i9
2014-02-21 13:45:57 +01:00
Christophe Simonis 49f26ffbc8 [MERGE] forward port of branch saas-2 up to revid 3950 dle@openerp.com-20140220141302-3paib80ixiyi66qg
bzr revid: chs@openerp.com-20140220161753-ec6l9ser1pbnmzgk
2014-02-20 17:17:53 +01:00
Xavier Morel cbc987191c [FIX] QUnitSuite: don't be self-recursive
bzr revid: xmo@openerp.com-20140218104347-u56pghrto948iclx
2014-02-18 11:43:47 +01:00
Antony Lesuisse 88741e98c6 [FIX] web test_ui test for view form instead of kanban
bzr revid: al@openerp.com-20140216223208-0gw9dev1jpxsskib
2014-02-16 23:32:08 +01:00
Antony Lesuisse 5c3c89a17c [FIX] tests move test_ui to web as it requires web.login template
bzr revid: al@openerp.com-20140216215039-448vh07674on9569
2014-02-16 22:50:39 +01:00
Antony Lesuisse 09a7519654 [IMP] phantomjs helper simplification
bzr revid: al@openerp.com-20140210005008-0vmwbofnfnuqaj3d
2014-02-10 01:50:08 +01:00
Antony Lesuisse 8f29812b0f [IMP] test_ui shorter code
bzr revid: al@openerp.com-20140209234743-n3015x520z9zs4qz
2014-02-10 00:47:43 +01:00
Antony Lesuisse 85d37619e4 [IMP] add test_ui
bzr revid: al@openerp.com-20140209232001-1efvws2pzeldbuhb
2014-02-10 00:20:01 +01:00
Antony Lesuisse c954e9adf2 fix web tests
bzr revid: al@openerp.com-20140209004310-0jpc29beh7k1e27c
2014-02-09 01:43:10 +01:00
Christophe Simonis ef14282df0 [FIX] tests: pass correct passwords to js
bzr revid: chs@openerp.com-20140203141506-zmfhd7g0zorveb5v
2014-02-03 15:15:06 +01:00
Xavier Morel b78703c122 [IMP] console.log js output should be piped to stdout during JS tests
bzr revid: xmo@openerp.com-20140131152612-rqxkge24w6p95q10
2014-01-31 16:26:12 +01:00
Xavier Morel 99743cae43 [REM] useless comment
the database password is necessary to duplicate databases

bzr revid: xmo@openerp.com-20140131110748-nfguxwjysgbn6y3y
2014-01-31 12:07:48 +01:00
Martin Trigaux 4b7799c0c7 [IMP] search_read: use search_read from the orm instead of rewritting it
skip search_count when getting no result from search_read
remove useless test based on implementation details

bzr revid: mat@openerp.com-20140117120047-9b5emsrbtjauvegl
2014-01-17 13:00:47 +01:00