Introduction
The robot is a autonomous testing framework which can be configured to run indefinitely on any machine to download a new pre-release of ganga and to test any part of it automatically.
It is an implementation of
GangaRobot with the actions Checker, Installer, Tester, Cleaner. The checker periodically checks for updates to the
VERSIONS
file and if found, will then proceed to install the new releases and test them using the tests defined in the configuration file. The cleaner then removes then new releases, and tidies up.
Usage
The command to start the
TestRobot is:
ganga --config-path=GangaTest/Lib/TestRobot/TESTROBOT.INI robot run
Note:
You will need to have manually removed any previously created
LastVersionFile from the ~/gangadir_testrobot directory before running the robot afresh.
Functionality:
It is possible to run the
TestRobot to test just one release, or to test as many releases as you like. This is configured in the 'VersionTime' config option, and it will test all releases newer then this time. If you want it to test one release, set the
GangaRobot Driver_Repeat = False, and it will only run once, testing the release immediately after the
VersionTime set.
The gangadir for
TestRobot is defaulted to ~/gangadir_testrobot, which contains the Releases Directory, and the Jobs directory. Each test is run as an individual job in ganga, and the job files have their own directory. The reports from the testing go in the reports folder of each specific job directory.
A heartbeat file is created regularly, and if indefinite running is required, it suggested to use a cron job to run the file
TestRobot/heartbeatchecker.py which will check for a recently updated heartbeatfile, and then if not, kill the process and restart the
TestRobot with the above command.
Configuration:
All this is contained within TESTROBOT.INI, which is located in GangaTest/Lib/TestRobot/TESTROBOT.INI
These are the main configurable variables for
TestRobot:
#Default URL to check for Ganga releases
#ReleasePath = http://cern/ch/ganga/download/
#default install path for Ganga scratch testing
#InstallPath = None
#dir to put job data in
#JobDir= None
#Add additional plugins if non-vanilla tests are required
#PluginsRequired = GangaTest
#These are the tests to perform, and the place to which the jobs are submitted
#TestPairs = [['Ganga', 'Local', 'local'], ['GangaLHCb', 'LCG', 'remote']]
#Blank default release number - to be set in session
#ReleaseNumber = None
#time out for the tests in SECONDS
#JobTimeOut = 1800
#Time of upload of last pre-release tested
#VersionTime = None
#Last Version tested
#VersionNumber = None
#Time to wait between checking of new releases
#SleepTime = 600
#If you require the autonomous process to email you on startup following a fail
#EmailOnStartup = False
#Last Checked Time of the VERSIONS.txt
#LastCheckedTime = 0
Robot
The default actions are:
Driver_Run = ['check', 'install', 'test', 'clean']
with indefinite running set by:
Driver_Repeat = True
The email functionality is configured by the variables in the Robot configuration section:
# smtp host and port
#FileEmailer_Host = localhost:25
# from address
#FileEmailer_From = as1905@ic.ac.uk
# recipients addresses (if empty no email is sent)
#should be in format: recipient1@d.org, recipient2@d.org
#FileEmailer_Recipients = as1905@ic.ac.uk
# subject for email, ${runid} is replaced by current run id.
#FileEmailer_Subject = Ganga Robot: ${runid}.
If you are planning to run the
TestRobot autonomously, then you will need to check that the crontab is set up, and that the command given in the heartbeat file is correct for starting up ganga on your system
If you want to check for a avaliable grid proxy, you need to include the 'proxy' action in this line in the config
[Robot]
Driver_Run = ['check', 'proxy', 'install', 'test', 'clean']
<\verbatim>
-- Main.AlexShires - 03 Sep 2008