Project

General

Profile

Appion Testing » History » Version 2

Amber Herold, 04/25/2011 10:54 AM

1 1 Amber Herold
h1. Appion Testing
2
3
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.
4
5
The follow steps should be taken to add a new test.
6 2 Amber Herold
# Select a session to be used as the test dataset. At AMI, test data set projects are named with the following format: zz_parttype_partname
7
The test session names begin with "zz_". 
8 1 Amber Herold
See issue #1229 for more information on AMI's test data sets.
9 2 Amber Herold
# Add the session name to the $TEST_SESSIONS array located in config.php in the myamiweb directory.
10
# Make a copy of test_zz07jul25b.py located in myami/appion/bin and rename it to match your session name with "test_" prepended. 
11
# Edit the new "test_zz....py" file.
12
## Change the following class name at the beginning of the file to reflect your test session name:
13
<pre> class Test_zz07jul25b(testScript.TestScript):</pre>
14
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.
15
## 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:
16
<pre>
17
if __name__ == "__main__":
18
	tester = Test_zz07jul25b()
19
</pre>
20
This main function will create an instance of your new class, run the start() function and finally run the close() function.
21
## 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.