Running Automated Tests with testrunner
In order to run your tests you need to have:
1. Checked out the repository
2. Written your test in the trunk/scripts directory (This example is for scooby tests)
In this case your test file goes in tools/trunk/scripts
3. Have the destination server running
You have downloaded, configured and are running your server, (for osaf: scooby/cosmo bundle) defaults to localhost.
4. If you have run previous tests, remove the users that were created or they will report failures
For cosmo: In your browser goto destination:8080 and login to cosmo as root : cosmo and then click users. Click remove next to each of the test users that will be affected.
Actually Running Your Test
The script we use to run the tests is named testrunner.py, this lives in the trunk which is the parents of the scripts directory where your test lives and is used to run tests with cmp and json-rpc.
Example:
adam$ python testrunner.py tests=test1:class1,test2:class2 recurrence=20 debug=1
Available Parameters:
host - Location of server instance, defaults localhost
port - The port its running, defaults to 8080
path - This is the url path (ex. /cosmo or /scooby). Defaults to /scooby
recurrence - This is how many times its going to execute. (add 100 events, or calendars etc. depending on the test.) defaults 0
debug - this defines the level of output, defauts to 0
tests - this a list of the tests to run delimited by commas, each test needs the test and class to be instantiated, colon delimited
- Example(the test name and classname don't have to be the same they just happen to be that way with the scoobytests):
- tests=test1:class1,test2:class2,testx:classx
To run your test you use the command line, example:
adam$ cd tools/trunk/
adam$ ls
modules scripts stress.py testrunner.py
adam$ python testrunner.py tests=myTest:myTest recurrence=20 debug=1
Starting New Test :: Setup Accounts
startingTest Setup Accounts
Passed :: Test Status Code Check on 201 :: None
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Passed :: Test verifyListInResponse :: None,['error']
Recurrences :: 20
Failures :: 0
Passes :: 43
Total tests run :: 43