Commit Graph

364 Commits

Author SHA1 Message Date
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
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
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
Xavier Morel d5cb5c2a14 [FIX] correctly display JS stack frames in phantomjs runner
altered reporting to handle and deserialize JSON if JSON-deserializable. Can't
just send multiple lines as driver currently does not handle multiple lines of
message... Yeah turns out having a JSON-based protocol between phantomjs and
the python runner allowed multiple lines in messages, who'd have thought eh?

bzr revid: xmo@openerp.com-20140219123850-0h0upb3x33j7leqk
2014-02-19 13:38:50 +01:00
Xavier Morel fbead8fab1 [IMP] style
use break instead of return so cleanup can eventually be put after loop if necessary (?)

bzr revid: xmo@openerp.com-20140219101334-n8fcmzxptrqj717a
2014-02-19 11:13:34 +01:00
Xavier Morel abb58ee3b8 [FIX] possibility of select being interrupted, just restart the call
uses EnvironmentError because not sure if socket.error or os.error

bzr revid: xmo@openerp.com-20140219101110-4g4o658vzsol7jae
2014-02-19 11:11:10 +01:00
Xavier Morel cb03b384b0 [IMP] phantomjs runner
* use Skip exception to skip tests in case phantomjs binary not found
* remove spurious logging, move some to debug when debatable
* use testing assertions for correct reporting
* allow failure message
* use mutable buffer to accumulate stdout data

bzr revid: xmo@openerp.com-20140218133445-e5l155j10i934o88
2014-02-18 14:34:45 +01:00
Xavier Morel 71259f09f4 [ADD] hooks to enable/disable tests running during install
also add flag for post_install run, but not used yet

bzr revid: xmo@openerp.com-20140218095452-pptez5rlpdez1ttl
2014-02-18 10:54:52 +01:00
Antony Lesuisse 75c350976c [FIX] tests HttpCase phantomjs conditional injection inject=[(need,file)]
bzr revid: al@openerp.com-20140217000150-wt3pwqrqcd7n2mfd
2014-02-17 01:01:50 +01:00
Antony Lesuisse c8324bafcc [IMP] phantomjs testing
- avoid dbmanager by presetting db in the test session
- correctly handle login option
- serialize test cursor access

bzr revid: al@openerp.com-20140216212222-4o6x9uljyua3g1og
2014-02-16 22:22:22 +01:00
Antony Lesuisse 42db02f73c [FIX] tests HTTPCase if phantomjs is not installed
bzr revid: al@openerp.com-20140216162026-ymbzoi70txbr64yl
2014-02-16 17:20:26 +01:00
Christophe Matthieu 90ed82bb14 [IMP] test phantomtest: inject files with testing if a variable is already setted
bzr revid: chm@openerp.com-20140210131910-z8eggofegua88516
2014-02-10 14:19:10 +01:00
Antony Lesuisse 1f78dfb76d [IMP] phantomjs testing add an easy phantom_js helper
self.phantom_js(<page_to_load>, <code_to_run>, <global_object_to_wait>, **options)

example:

self.phantom_js("/", "openerp.module.mytest()", "openerp.module.mytest");

console.log('ok') or console.log('error') should be used to signal success or
failure. Other console.log's will be passed to the test logger.

bzr revid: al@openerp.com-20140210004517-jc2cobc31qshxchm
2014-02-10 01:45:17 +01:00
Antony Lesuisse 1f67b2165c [IMP] phantomtest helper
bzr revid: al@openerp.com-20140209223917-vruzjvl0mtsqoo87
2014-02-09 23:39:17 +01:00
Antony Lesuisse e6ac29ee43 [IMP] move test cases to tests.py remove deprecated wsgi import
bzr revid: al@openerp.com-20140209151822-cgk0wibqe1kfd42w
2014-02-09 16:18:22 +01:00
Antony Lesuisse 278ed718e9 new test execution engine
remove deprecated zipfile support
add preload_registry option when server is running
allow registries to be used in contruction in test mode
add a rollback test case for http tests
add a phantomjs helper

bzr revid: al@openerp.com-20140209004005-p5pwym4sqc23vw5b
2014-02-09 01:40:05 +01:00
Antony Lesuisse 82372e6a02 move tests
move test modules
remove xml test
add phantomjs test
readd remove uninstall test (currently disabled because of cr.commit)

bzr revid: al@openerp.com-20140209003745-ehrx8ikwkmusa644
2014-02-09 01:37:45 +01:00
Fabien Pinckaers 849125efd2 [FIX] removing test that commits and small fix
bzr revid: fp@tinyerp.com-20140131002701-4eaggu8tszph4vl5
2014-01-31 01:27:01 +01:00
Olivier Dony 95d3995614 [MERGE] Sync with trunk revno 5038 rev-id ged@openerp.com-20140127161125-2br49sy5bnyuen7f
bzr revid: odo@openerp.com-20140128184158-19hj4mg83jazp3nr
2014-01-28 19:41:58 +01:00
Christophe Simonis a47f7ef8e8 [FIX] do not hardcode demo uid
bzr revid: chs@openerp.com-20140128180910-2udedma5dwwtos4c
2014-01-28 19:09:10 +01:00
Xavier Morel 98bb821332 [FIX] fubared ir_filters tests
bzr revid: xmo@openerp.com-20140128164849-iv19wiwx2074l18f
2014-01-28 17:48:49 +01:00
jke-openerp c9fa796513 [FIX] Remove hard code demo user ID
bzr revid: jke@openerp.com-20140128155640-9k5kvk711tt9w9o5
2014-01-28 16:56:40 +01:00
Gery Debongnie a42900b8ea [FIX] fixes the read_group by dates tests (makes them use the field:interval syntax instead of using the context (test_orm.py)
bzr revid: ged@openerp.com-20140123130603-5kdlb7as7fhmchd8
2014-01-23 14:06:03 +01:00
Gery Debongnie 99230cd3d1 [FIX] prints some value so i can understand how to debug the failing test in test_orm.py
bzr revid: ged@openerp.com-20140123112347-0swvj6xrhp5r5mpq
2014-01-23 12:23:47 +01:00
Gery Debongnie 74fd48e608 [FIX] fixes the read_group by dates tests (makes them use the field:interval syntax instead of using the context (test_orm.py)
bzr revid: ged@openerp.com-20140123105638-l4ej76ynf4avcjma
2014-01-23 11:56:38 +01:00
Thibault Delavallée ab5c23079a [MERGE] Sync with trunk, solved conflicts.
bzr revid: tde@openerp.com-20140116091716-zk1n5ots94i65io5
2014-01-16 10:17:16 +01:00
Christophe Simonis 0771ca2692 [MERGE] forward port of branch saas-2 up to revid 5002 dle@openerp.com-20140114173613-ruxye1m7fxtcjfim
bzr revid: chs@openerp.com-20140115205357-arptzm69logz3osm
2014-01-15 21:53:57 +01:00
Christophe Simonis a69f789b41 [MERGE] forward port of branch 7.0 up to revid 5224 chs@openerp.com-20140206105141-7e8bv8ordqqsswh7
bzr revid: dle@openerp.com-20140205105045-j95kduyjiq83e57z
bzr revid: dle@openerp.com-20140114173613-ruxye1m7fxtcjfim
bzr revid: dle@openerp.com-20140116161158-u95vcs3os4tk2zob
bzr revid: dle@openerp.com-20140121172737-gzawfi3ssg7xifef
bzr revid: chs@openerp.com-20140129094554-c3abc8x3qz9mpszr
bzr revid: chs@openerp.com-20140129140159-9vwkpr078shoonum
bzr revid: chs@openerp.com-20140206110220-myn57cryam1y4k9v
2014-02-06 12:02:20 +01:00