Commits
Sandra M Castro authored 98f78c6f494
1 - | ## CASAtests |
1 + | # CASAtests |
2 2 | |
3 3 | CASAtests is a self-contained python module that provides special test scripts for CASA. Many of the tests in this package depend on the [casatestutils](https://open-bitbucket.nrao.edu/projects/CASA/repos/casa6/browse) python module being pre-installed in your system. |
4 4 | |
5 - | ### Install dependencies |
5 + | ## Install dependencies |
6 6 | |
7 7 | First make sure you have installed the CASAtools, the CASAtasks and the CASAtestutils before you run the tests. Below is a quick guide on how to install |
8 8 | them with pip. |
9 + | |
9 10 | ``` |
10 11 | -bash-4.2# python3 -m venv casa6_0 |
11 12 | -bash-4.2# source casa6_0/bin/activate |
12 13 | -bash-4.2# pip3 install --extra-index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatools |
13 14 | -bash-4.2# pip3 install --extra-index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatasks |
14 15 | -bash-4.2# pip3 install --extra-index-url https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatestutils |
15 16 | ``` |
16 17 | |
17 - | ### Data sets for the tests |
18 + | ## Data sets for the tests |
18 19 | |
19 - | Download the datasets from https://open-bitbucket.nrao.edu/scm/casa/casa-data-req.git |
20 + | Download the datasets from https://open-bitbucket.nrao.edu/scm/casa/casatestdata.git |
20 21 | |
21 22 | Add to $HOME/.casa/config.py the following line, pointing to the locations of your datasets |
23 + | |
22 24 | ``` |
23 25 | -bash-4.2# cat $HOME/.casa/config.py |
24 - | datapath=[ "/your-data-dir/casa-data/" , "/your-data-dir/casa-data-req/","/your-data-dir/mydata/"] |
26 + | datapath=[ "/your-data-dir/casatestdata/","/your-data-dir/mydata/"] |
25 27 | ``` |
26 - | ### Run tests |
28 + | ## Run tests |
27 29 | |
28 30 | All tests added to casatests must be able to run with Python. |
29 31 | |
30 - | #### Run a single test using Python |
32 + | ### Run a single test using Python |
31 33 | |
32 34 | The following performance test will look for a dataset located in <your_data_dir>/visibilities/alma/. |
33 35 | Make sure your config.py datapath has an entry pointing to <your_data_dir>. |
34 36 | |
35 37 | ``` |
36 38 | -bash-4.2# python3 ./casatests/performance/test_perf_tclean_mem_setweighting.py |
37 39 | ``` |
38 40 | |
39 - | #### Run a test using pytest (it needs to be pre-installed with pip3) |
41 + | #### Run a single test using a casalith tarball; with python3, casa or [runtest.py](https://open-bitbucket.nrao.edu/projects/CASA/repos/casa6/browse/casatestutils/casatestutils/runtest.py) |
42 + | |
40 43 | ``` |
41 - | -bash-4.2# pytest ./casatests/performance/test_perf_tclean_mem_setweighting.py |
44 + | -bash-4.2# ./casa-6.1.0/bin/python3 ./casa6/casatests/regression/test_regression_alma_M100_sd.py |
45 + | -bash-4.2# ./casa-6.1.0/bin/casa -c ./casa6/casatests/regression/test_regression_alma_M100_sd.py |
46 + | -bash-4.2# ./casa-6.1.0/bin/casa -c ./casa-6.1.0/lib/py/lib/python3.6/site-packages/casatestutils/runtest.py ./casa6/casatests/regression/test_regression_alma_M100_sd.py |
42 47 | ``` |
43 48 | |
44 - | #### Run a single test using a casalith tarball |
45 - | First, install the casatestutils wheel using the pip3 from the tarball and run the test with python3 or the casa binary. Example: |
49 + | #### Run the ALMA stakeholders tests |
50 + | |
46 51 | ``` |
47 - | -bash-4.2# ./casa-6.1.0/bin/pip3 install https://casa-pip.nrao.edu/repository/pypi-casa-release/simple casatestutils |
48 - | -bash-4.2# ./casa-6.1.0/bin/python3 ./casatests/performance/test_perf_tclean_mem_setweighting.py |
49 - | -bash-4.2# ./casa-6.1.0/bin/casa -c ./casatests/performance/test_perf_tclean_mem_setweighting.py |
52 + | -bash-4.2# ./casa-6.1.0/bin/casa -c ./casa6/casatests/stakeholder/test_stk_alma_pipeline_imaging.py |
50 53 | ``` |
51 54 | |
52 - | #### Run all stakeholders test |
53 - | ...... |
54 - | |
55 55 | ### Add a new test to casatests |
56 56 | |
57 57 | The following is the naming convention for tests added to the directories inside casatests. |
58 58 | |
59 - | #### performance: Tests related to memory, I/O, runtime, number of file descriptors, etc. |
59 + | #### `performance`: **Tests related to memory, I/O, runtime, number of file descriptors, etc. ** |
60 60 | * test\_perf\_[taskname]\_[description]\_[...].py |
61 61 | * e.g. test\_perf\_tclean\_mem\_setweighting.py |
62 62 | * e.g. test\_perf\_tclean\_runtime\_cube\_model\_write.py |
63 63 | |
64 - | #### stakeholder: Tests exercising specific stakeholders use-cases |
64 + | #### `stakeholder`: Tests exercising specific stakeholders use-cases |
65 65 | * test\_stk\_[stakeholder]\_[taskname]\_[description].py |
66 66 | * e.g. test\_stk\_alma\_pipeline\_tclean\_cycle8.py |
67 67 | |
68 - | #### regression: Regression scripts, multi-task tests |
68 + | #### `regression`: Regression scripts, multi-task tests |
69 69 | * test\_regression\_[description]\_[...].py |
70 70 | * e.g. test\_regression\_alma\_m100\_if.py |
71 71 | * e.g. test\_regression\_alma\_m100\_sd.py |
72 72 | |
73 - | #### pipeline: Tests exercising the pipelines |
73 + | #### `pipeline`: Tests exercising the pipelines |
74 74 | * test\_pipe\_[telescope]\_[use-case]\_[description]\_[...].py |
75 75 | * e.g. test\_pipe\_vlass\_calib\_[...].py |
76 76 | * e.g. test\_pipe\_alma\_full\_ephem.py |
77 77 | |
78 - | #### benchmark: Tests measuring benchmarks of CASA tasks/tools |
78 + | #### `benchmark`: Tests measuring benchmarks of CASA tasks/tools |
79 79 | * test\_bench\_[description]\_[...].py |
80 80 | |
81 81 | |
82 82 | |
83 83 | |