CASA Test System
-
Upload
bruce-brewer -
Category
Documents
-
view
46 -
download
0
description
Transcript of CASA Test System
CASA Test System
Summary of available tests e2e, unit tests (C++, Python)
Writing and running tests
Monitoring tests
When to run, which tests
Future plans
April 20, 2023 2Sandra Castro
Summary of tests
e2e tests tests of science use cases; full-chain data
reduction; sometimes slow
C++ unit tests unit testing of C++ code; single methods; fast
Python unit tests (NEW) unit testing of individual CASA tasks; fast PyUnit and nose
April 20, 2023 3Sandra Castro
Python unit tests
Some scripts in scripts/regressions/tests were actually unit tests
They have been converted to PyUnit and moved to a new location
April 20, 2023 Sandra Castro 5
Converted tests = (new name, new location, new driver, new look, same content, standard way of writing, better reporting)
Catch errors before they go to the repository
List of Python unit tests
April 20, 2023 Sandra Castro 6
They are located in: code/xmlcasa/scripts/tests
Writing new tests
e2e test
example of 3C129.py in Eclipse
Python unit test
examples of test_clean in Eclipse
April 20, 2023 7Sandra Castro
https://safe.nrao.edu/wiki/bin/view/Software/CASARegressionTesting
Running tests
e2e tests publish_summary, execfile
C++ unit tests make check
Python unit tests runUnitTest.py, which uses nose. It can be run inside or outside casapy.
April 20, 2023 8Sandra Castro
Running e2e tests
April 20, 2023 Sandra Castro 9
CASA <18>: sys.path.append('/opt/casa/active/code/xmlcasa/scripts/regressions/admin’)CASA <19>: import publish_summaryCASA <20>: publish_summary.runTest(’3C129')
It will search and copy or link the data to a temporary directory and run the scripts from there.
CASA <21>: execfile(’3C129_tutorial_regression.py')
Data must be in the current directory.
Running Python unit tests
April 20, 2023 Sandra Castro 10
Show on a Terminal window:
Open test_clean and test_boxit
Run test_boxit. Run test_clean[test4]
Edit test_clean, include an error and run it again, together with test_boxit
Look at nosedir directory
--help, --short, --file --list options
How to run the full suite of tests
Monitoring the tests
e2e tests show HTML pages http://www.eso.org/~jmlarsen/ALMA/CASA/test-
report.html
Unit tests show Hudson. Browse through one test with
failure http://www.eso.org/alma-casa-hudson/view/unit
%20test/
April 20, 2023 11Sandra Castro
When, which?
When to run e2e tests? They run automatically, but if solving a JIRA
ticket, the e2e tests should pass before the ticket is closed.
When to run unit tests? C++ UTs: when building (make check) Python UTs also run automatically a few times
per day
April 20, 2023 13Sandra Castro
When writing/modifying code related to a task Before committing to active