Changes between Version 119 and Version 120 of Dev/Tests


Ignore:
Timestamp:
02/15/10 00:52:23 (3 years ago)
Author:
jnguyenx
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Dev/Tests

    v119 v120  
    246246The only line to add is '''else: sel.click("addLink")'''. 
    247247 
    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? 
     248Finally, 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 
     251indicoPath = '/home/jeremy/cds-indico' 
     252seleniumToTest = '/home/jeremy/cds-indico/tests/python/functional/example_test.py:ExampleTest.testCreateDeleteLecture' 
     253}}} 
    250254 
    251255=== 2.c. Naming conventions === 
     
    413417}}} 
    414418This will generate a report in ''tests/report/pygrid.txt''. 
    415 Now lean back and enjoy a cup of tea! But most important, do '''NOT''' press CTRL-C! This will jamm the hub and it will be unusable unless we restart it. 
     419Now lean back and enjoy a cup of tea! But most important, do '''NOT''' press CTRL-C! This will jam the hub and it will be unusable unless we restart it. 
    416420 
    417421== 7. Databases - Fake vs Production == 
    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/ 
     422The idea is to run the tests on the fake databases and temporary folders, so tests won't pollute anything with their ouputs. 
     423 
     424A 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 
     426To 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) == 
     429Each 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).