Appion Testing » History » Version 3
Amber Herold, 04/25/2011 11:08 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 | 3 | Amber Herold | ## 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. If you need to execute a function that is not available in the TestScript class, you can add the function to the base class (TestScript) so that other test classes can use it, or, if the function is very specific to the data set that you are testing, you can add a new function directly to your new class. |
22 | # Run your test |
||
23 | ## Select your test session in the Appion Image Viewer and select Processing. |
||
24 | ## Scroll down to the bottom of the menu and select "Run Test Script" |
||
25 | ## Under <pre>Limit: only process images <pre> enter a small number between 1 and 10. |
||
26 | ## Select "just show command" and copy the resulting command to past into a terminal. See .... for more info on running from your sandbox. |
||
27 | ## Once the test has run, click on the # complete link under the Testing Tools section of the menu. Notice your test run information. |
||
28 | ## Select the test run to view a summary of the commands that were executed. Clicking on any of these will show more details of the run. |