Project

General

Profile

Appion Testing » History » Revision 2

Revision 1 (Amber Herold, 04/25/2011 09:58 AM) → Revision 2/9 (Amber Herold, 04/25/2011 10:54 AM)

h1. Appion Testing 

 There is a framework in place to write a test script for a particular data set that can be run on demand. The tests may be launched from the website and results of each executed command may be viewed from the web. 

 The follow steps should be taken to add a new test. 
 # Select a session to be used as the test dataset. At AMI, test data set projects datasets are named with the following format: zz_parttype_partname 
 The test session names begin with "zz_".  
 See issue #1229 for more information on AMI's test data sets. 
 # Add the session name to the $TEST_SESSIONS array located in config.php in the myamiweb directory. 
 # Make a copy of test_zz07jul25b.py located in myami/appion/bin and rename it to match your session name with "test_" prepended.  
 # Edit the new "test_zz....py" file. 
 ## Change the following class name at the beginning of the file to reflect your test session name: 
 <pre> class Test_zz07jul25b(testScript.TestScript):</pre> 
 This new class inherits all the properties and methods of the base class, TestScript, which is defined in myami/appion/appionlib/testScript.py. The TestScript class includes functions to create and execute commmands for many of the Appion programs like dogpicker, pyace, maxlikeAlign, uploadTemplate, etc. 
 ## At the bottom of the file replace the name of the class to be instantiated in the main function to match your new class name: 
 <pre> 
 if __name__ == "__main__": 
	 tester = Test_zz07jul25b() 
 </pre> 
 This main function will create an instance of your new class, run the start() function and finally run the close() function. 
 ## Modify the start() function of your new class to run the commands relevant to your data set. Review the functions available in testScript.py to decide which parameters need to be set for each function.