| 248 | | Finally, a test might work at several times and suddenly fail in the next run because of the reasons mentioned earlier. Running a test several times is a good indication to say if it is reliable or not. Use the script, it will run the test 20 times and see if it fails. |
| 249 | | TODO: Where to put the script? |
| | 248 | Finally, a test might work at several times and suddenly fail in the next run because of the reasons mentioned earlier. Running a test several times is a good indication to say if it is reliable or not. Use the script located in ''tests/python/functional/loop.py'', it will run the test 10 times and see if it fails. You just need to configure the path to your root indico directory and to define the test you want to run, using nose style. Here's an example: |
| | 249 | {{{ |
| | 250 | #!python |
| | 251 | indicoPath = '/home/jeremy/cds-indico' |
| | 252 | seleniumToTest = '/home/jeremy/cds-indico/tests/python/functional/example_test.py:ExampleTest.testCreateDeleteLecture' |
| | 253 | }}} |
| 418 | | The idea is to run the tests on the fake databases and temporary folders, so tests won't pollute anything with ouputs. |
| 419 | | |
| 420 | | TODO |
| 421 | | |
| 422 | | == 8. TODO == |
| 423 | | Bitten for trac |
| 424 | | Performance: |
| 425 | | Profiler using selenium and python: http://code.google.com/p/selenium-profiler/ |
| | 422 | The idea is to run the tests on the fake databases and temporary folders, so tests won't pollute anything with their ouputs. |
| | 423 | |
| | 424 | A fake database is instantiate at each run. Which means that if you have decided to run unit and functional tests, those tests are going to run on the same database, and after they have finished, this database will be deleted. |
| | 425 | |
| | 426 | To run only the unit tests, we can instantiate a database in parallel of the production database. However for the functional tests, we need to stop the production database (if running) in order to plug our fake database instead. This way, we will avoid to restart the apache server to run our tests. So make sure to provide the commands to stop and start the production database in the tests configuration file (''tests/tests.conf''). |
| | 427 | |
| | 428 | == 8. Integration server (CERN only) == |
| | 429 | Each time you push code to your public repository, an integration server is going to run tests and give you a feedback. You can consult the builds status à this address: (currently down). |