Commit Graph

392 Commits

Author SHA1 Message Date
Antony Lesuisse 5a642a802e [FIX] test phantomjs discard stderr
To avoid phantomjs broken pipe messages on odoo stderr during testing.
2015-01-09 01:21:42 +01:00
Raphael Collet 86ba01976e [FIX] tests: make self.assertRaises() return the expected object 2014-11-17 15:39:14 +01:00
Raphael Collet 908252ec88 [FIX] tests: make sure that a failed tests does not leave the environment dirty
When a failure occurs, or when exiting an assertRaises(), the environment
should not contain fields to recompute.
2014-11-17 14:07:42 +01:00
Xavier Morel bc59cfce61 [IMP] doc: add testing reference and improve docstrings 2014-10-09 15:38:36 +02:00
Olivier Dony 79570179bf [MERGE] Forward-port saas-5 up to acbdac4 2014-08-14 14:56:57 +02:00
Olivier Dony acbdac4e9f [MERGE] Forward-port saas-4 up to 9a84d55 2014-08-14 14:54:37 +02:00
Olivier Dony 9a84d55036 [MERGE] Forward-port saas-3 up to 9b55532 2014-08-14 14:37:42 +02:00
Olivier Dony 8b12d1c566 [MERGE] Forward-port of 7.0 up to 85d2b45 2014-08-14 04:11:33 +02:00
Vo Minh Thu 680214c47e [FIX] tools.translate: when loading entries from a PO file, use also the POT.
On Launchpad, as commented on bug 933496, PO entries (and their comments) are
shared between series. This mean that e.g. the 7.0 series can have the wrong
`reference` comments (those beginning with #:) as they would be copied from say
the trunk series. Those `reference` comments are used to import translations
and look them up.

This patch adds a few lines of code to tools.translate so that targets
defined in the POT `reference` comments are used in addition to those from the
PO file.

Also adds a test module to validate the new behavior.

This patch stems from:
 - the 6.1 branch by Vo Minh Thu:
    https://code.launchpad.net/+branch/~openerp-dev/openobject-server/6.1-fix-po-targets-933496-vmt
 - the 7.0 port by Numerigraphe:
    https://code.launchpad.net/~numerigraphe-team/openobject-server/7.0-fix-po-targets-933496-vmt
2014-08-13 23:07:40 +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
Antony Lesuisse 0ef85c5a60 [FIX] test phantomjs manually delete localstorage 2014-06-30 17:23:38 +02:00
Antony Lesuisse 3bb7866384 [FIX] test phantomjs clear localstorage before running tests 2014-06-30 16:32:02 +02:00
Antony Lesuisse 78e044b5c7 [IMP] test impprove HTTPCase opener
Simplify website crawler using the generic HTTPCase opener
2014-06-29 20:04:30 +02:00
Christophe Simonis 1f57528bc6 [MERGE] forward port of branch saas-5 up to 8dfd5ea 2014-06-27 16:14:40 +02:00
Simon Lejeune ebb3f1aad1 [FIX] use unique localstorage path when running phantomjs tests
this patch use a unique localstorage per test at al request. It could have used one localstorage per instance or even per module.
2014-06-26 14:06:20 +02:00
Christophe Simonis 4cd699df15 [IMP] js testing
- output "error" if any qunit tests failed
- failed js tests are logged as errors
- when running phantomjs considere empty waiting condition or initialisation code as "true"
- lint phantomtest.js file
2014-06-22 11:31:07 +02:00
Antony Lesuisse 739793cdcd [FIX] tests race condition in phanthomjs tests
A deadlock occurs when
- phantomjs_test1 is executedd, enter_test_mode is activated
- console.log('ok') is issued, sigterm is sent to phantomjs_test1 process
- phantomjs_test1 is finished and leave_test_mode restores the registrymanager lock
- phantomjs_test1 process, just before dying, makes a last http request phantomjs_test1_last_request
- phantomjs_test1_last_request thread will wait for the registrymanager lock, when all tests will be completed 
- phantomjs_test2 is run, enter_test_mode is activated
- phantomjs_test2 is reach its end and _wait_remaining_requests is called
- phantomjs_test2 _wait_remaining_requests hangs forever waiting for phantomjs_test1_last_request

bzr revid: al@openerp.com-20140501150641-ua0b7pntesgm3n5p
2014-05-01 17:06:41 +02:00
Antony Lesuisse f0dcf52159 [FIX] instrumentation to debug a deadlock probably due to a race condition in
the test cursor

bzr revid: al@openerp.com-20140411143645-ojb4t9plop4dmizh
2014-04-11 16:36:45 +02:00
Christophe Simonis 95701c28c0 [FIX] test: HttpCase wait http requests to finish
bzr revid: chs@openerp.com-20140410123519-wngil3aghdc6llqc
2014-04-10 14:35:19 +02:00
Raphael Collet e5e00e4c0a [IMP] registry: now cursor() simply returns a cursor, which may itself be used as a context manager
bzr revid: rco@openerp.com-20140409095604-joh9dt0qkma12ykm
2014-04-09 11:56:04 +02:00
Raphael Collet f0fd48c44a [IMP] http tests: implement a test cursor that keeps a transaction open accross requests
- TestCursor subclasses Cursor, and simulates commit and rollback with savepoints
 - the registry manages a test mode, in which it only uses the test cursor
 - a reentrant lock forces the serialization of parallel requests

bzr revid: rco@openerp.com-20140408151736-j0guy68i2wjexy3d
2014-04-08 17:17:36 +02:00
Raphael Collet 6bc60505f4 [IMP] registry: add method get_cursor() to simply retrieve a new cursor, and refactor code to use it
bzr revid: rco@openerp.com-20140408125122-ki0zmin3m21k2itd
2014-04-08 14:51:22 +02:00
Raphael Collet b49f536baf [IMP] tests.common: turn class methods into instance methods (this will ease some future refactoring)
bzr revid: rco@openerp.com-20140408114936-jfagg4qvft8bk3ms
2014-04-08 13:49:36 +02:00
Raphael Collet 81b84c62b1 [IMP] registry: switch for a dummy lock only during the execution of http tests
bzr revid: rco@openerp.com-20140408094513-ahtwod1q17ijohbg
2014-04-08 11:45:13 +02:00
Antony Lesuisse 7c29e3847c [FIX] increase js test timeout to 60
when runbot is overloaded, test speed can be slow, 2s per HTTP request

bzr revid: al@openerp.com-20140403134109-nzg71xmybw1p5bsi
2014-04-03 15:41:09 +02:00
chm@openerp.com 82989d95f7 [FIX] phantomjs: hide error if document.body does not exists
bzr revid: chm@openerp.com-20140325092547-ilnbqdj4rhdo0q3r
2014-03-25 10:25:47 +01:00
chm@openerp.com ea901ebb1d [FIX] phantomjs: don't use error method because it's undefined in phantomjs evaluating environment
bzr revid: chm@openerp.com-20140319112027-buua40iyi7hgnlly
2014-03-19 12:20:27 +01:00
Antony Lesuisse 627b5b671e [FIX] tests dont log traceback on aborted request while testing
bzr revid: al@openerp.com-20140317135239-08aefkdxiil7bpcs
2014-03-17 14:52:39 +01:00
Antony Lesuisse 09deba4826 [FIX] tests dont generate traceback on aborted test requests
bzr revid: al@openerp.com-20140317124343-kgesa5c215z19vpn
2014-03-17 13:43:43 +01:00
Antony Lesuisse 338c0a3f5e [FIX] race condition for test cursors
If a test ends before handling all its http queries (serialised by a Rlock),
threads created for unfufilled queries may hang because the interrupted thread
might not have unlocked its cursor as it might have dissapeared from
HTTP_SESSION before request release_test_cursor. We now use the cursor itself
instead of HTTP_SESSION.

bzr revid: al@openerp.com-20140317031448-rffj7gixgk8jzeqp
2014-03-17 04:14:48 +01:00
Antony Lesuisse cde6e0f6c6 [FIX] no comments
bzr revid: al@openerp.com-20140316212127-l1rxz5zh4o92tv90
2014-03-16 22:21:27 +01:00
Antony Lesuisse c3ef6eb892 [FIX] tests typo in js tests result parsing
bzr revid: al@openerp.com-20140316200135-dyyl6u5uas4js90g
2014-03-16 21:01:35 +01:00
Antony Lesuisse 97a097dbab [IMP] tests log phantom to info the default loglevel of runbot
bzr revid: al@openerp.com-20140316195252-i6wr3scp0zmx92zu
2014-03-16 20:52:52 +01:00
Antony Lesuisse eac5185731 [IMP] phantom tests
- phantomjs more verbose
- revert to dumber console.log relay, dont try to be smart, just display it
- json is only optionally parsed for errors stack dumps

bzr revid: al@openerp.com-20140316160634-hh7br4mbg01xcrpk
2014-03-16 17:06:34 +01:00
Christophe Simonis c7d114d9a9 [MERGE] forward port of branch saas-2 up to revid 5020 chs@openerp.com-20140312174526-a5rhh83g0fw8djuc
bzr revid: chs@openerp.com-20140312180614-8yb454s3mkjwnk2q
2014-03-12 19:06:14 +01:00
Christophe Simonis 1c3ee251f0 [MERGE] forward port of branch 7.0 up to revid 5270 chs@openerp.com-20140403084524-9rb174osjrbmhgwc
bzr revid: chs@openerp.com-20140402083506-w4cywcf0kxxx9xmk
bzr revid: chs@openerp.com-20140312174526-a5rhh83g0fw8djuc
bzr revid: chs@openerp.com-20140318105837-53vsx5g7fm517cuc
bzr revid: dle@openerp.com-20140326092548-bu4bqinhvco8j5wj
bzr revid: chs@openerp.com-20140402092735-3a23yjl169vvt0iv
bzr revid: chs@openerp.com-20140402112825-ky8rcb3p467ikitc
bzr revid: chs@openerp.com-20140403084808-slnj7uis17kwi9js
2014-04-03 10:48:08 +02:00
Antony Lesuisse 096432ff73 [REV] reverting xmo@openerp.com-20140310115334-vjh7gx5oizdm6s67
This api change breaks jsfile tests (example test_ui_load.js). The api is broken
but the proper fix would be to avoid accessing phantom.args from PhantomTest

bzr revid: al@openerp.com-20140310184636-8r9x81xi1zqhcsek
2014-03-10 19:46:36 +01:00
Xavier Morel aaa80e9575 [IMP] phantomjs driver cleanups
bzr revid: xmo@openerp.com-20140310115334-vjh7gx5oizdm6s67
2014-03-10 12:53:34 +01:00
Xavier Morel bcbe89fbdc [IMP] phantomjs waitloop
* simplify waitFor itself
* log a "waiting for" message if the expression evaluates but is *false*

bzr revid: xmo@openerp.com-20140310112401-khvy0zcvwaaxa5om
2014-03-10 12:24:01 +01:00
Xavier Morel b3de4ca481 [IMP] readability of phantomjs timeouts
bzr revid: xmo@openerp.com-20140310101554-6imrb3hnd95q1wgu
2014-03-10 11:15:54 +01:00
Antony Lesuisse 3aa98edaaf [IMP] test add an url_open helper to http case
bzr revid: al@openerp.com-20140306234535-9zhumihumbzcddb2
2014-03-07 00:45:35 +01:00
Richard Mathot (OpenERP) 6f99891b82 [REF] Use assertEqual method instead of assert instruction
bzr revid: rim@openerp.com-20140306112053-e0znv1g2378ghs46
2014-03-06 12:20:53 +01:00
Richard Mathot (OpenERP) 3c65ffc29f [FIX] Test for ir_sequence:
This test was depending on the error string returned by postgresql.
As these strings are localized, the test was failing on systems 
where posgresql locale was not set to 'en_US'.

In this new version, we now check the error code returned by postgresql 
(which is, obviously, platform independent)

bzr revid: rim@openerp.com-20140306110356-72mgz3korkq3rkde
2014-03-06 12:03:56 +01:00
Olivier Dony 07fbbe288c [MERGE] Forward-port of 7.0 bugfixes, up to rev. 5251 revision-id: odo@openerp.com-20140304152927-havybom9x1jgdzae
bzr revid: odo@openerp.com-20140305213115-w55dqs3xra6ejmni
2014-03-05 22:31:15 +01:00
Thibault Delavallée 42e2676f4b [IMP] fields: html: now supports a sanitize argument, telling
whether the content of the html field should be sanitized before storage. This parameter
is true by default.
Example of use: html of email template is considered as html content, but contains
mako strings that makes this content not valid html. Sanitizing the body content
can cause issues to the template; therefore storing it as html but not sanitized
allows to keep its content safe.

Added a test case to ensure this behavior.

bzr revid: tde@openerp.com-20140227120254-6m8gvkt4hf28nl0e
2014-02-27 13:02:54 +01:00
Martin Trigaux 43df0b4d23 [MERGE] [FIX] orm: when generating xml ids for export, use the model of the exported field instead of the current model. Courtesy of Stefan Rijnhart (Therp).
bzr revid: mat@openerp.com-20140226133716-vgdjjmqc2lou0n3u
2014-02-26 14:37:16 +01:00
Xavier Morel 013d27b850 [IMP] filter out phantomjs warning on OSX
bzr revid: xmo@openerp.com-20140221143448-tpx62ua785kc8gfx
2014-02-21 15:34:48 +01:00
Xavier Morel fc780d5a81 [FIX] actually retry select on EINTR
Turns out select has its own select.error which does *not* subclass
EnvironmentError (or OSError or IOError) and does *not* have a .errno
attribute. So use the correct exception, might just work better than using
a completely different one with no relation.

bzr revid: xmo@openerp.com-20140219155303-sgz7m3gnzr2bmani
2014-02-19 16:53:03 +01:00
Martin Trigaux c83247c38b [MERGE] Forward-port of latest saas-2 bugfixes, up to rev.5012 revid:mat@openerp.com-20140219134943-60ssztc01cxdtk09
bzr revid: mat@openerp.com-20140219140617-na0q47yaloblb67i
2014-02-19 15:06:17 +01:00
Martin Trigaux e635ebe6c1 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5238 revid:launchpad_translations_on_behalf_of_openerp-20140219053940-dvi4g7ajttoj6h9k
bzr revid: mat@openerp.com-20140219134943-60ssztc01cxdtk09
2014-02-19 14:49:43 +01:00