140 likes | 394 Views
CASA Test System. Sandra Castro European Southern Observatory. 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. Summary of tests. e2e tests
E N D
CASA Test System Sandra Castro European Southern Observatory
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 Sandra 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 Sandra Castro
e2e Tests 3C219D imagetest ngc7538 3c129_tutorial ori_ch3oh accum irc_cs ori_ch3oh_task irc_cs_task ori_hc3n asdmv1-import irc_hc3n ori_hc3n_task async-segfault irc_hc3n_task ori_sio b0319 irc_sio ori_sio_task b1608_demo irc_sio_task orion cleanchan l02d cleanhelper leo2pt plotxy coordsystest listcal pointing cvel listvis polcal_20080224_cband fits-import-export maclog ppdisk flagdata_test.py nf run_orionmos4sim fls3a_hi ngc1333 sdtpimaging g192 ngc2403_tutorial ggtau ngc4826 testcube ghii ngc4826_tutorial wf h121 ngc4826c wproj3ddat ic2233 ngc5921 imagepoltest ngc5921_uvcontsub2 Sandra Castro
Python unit tests Catch errors before they go to the repository • Some scripts in scripts/regressions/tests were actually unit tests • They have been converted to PyUnit and moved to a new location • Converted tests = (new name, new location, new driver, new look, same content, standard way of writing, better reporting) Sandra Castro
List of Python unit tests test_importoldasdm.py test_exportasdm.py test_imhead.py test_imsmooth.py test_plotants.py test_vishead.py test_boxit.py test_hanningsmooth.py test_immath.py test_imstat.py test_plotms.py test_visstat.py test_clean.py test_importasdm.py test_imcontsub.py test_immoment.py test_imval.py test_report.py test_clearstat.py test_imfit.py test_imregrid.py test_listhistory.py test_smoothcal.py test_csvclean.py test_importfitsidi.py test_importevla.py code/xmlcasa/scripts/tests They are located in: Sandra Castro
Writing new tests • e2e test • example of 3C129.py in Eclipse • Python unit test • examples of test_clean in Eclipse https://safe.nrao.edu/wiki/bin/view/Software/CASARegressionTesting http://www.eso.org/~scastro/ALMA/CASAUnitTests.htm Sandra Castro
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. Sandra Castro
Running e2e tests CASA <18>: sys.path.append('/opt/casa/active/code/xmlcasa/scripts/regressions/admin’) CASA <19>: import publish_summary CASA <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. Sandra Castro
Running Python unit tests • 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 Sandra Castro
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/ Sandra Castro
Recent catches Sandra 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 • When writing/modifying code related to a task • Before committing to active Sandra Castro
Future plans • e2e tests • replace VLA data with EVLA • add scripts using ALMA commissioning data • unit tests • write unit tests for other tasks • speed up some slow tests using simdata • make sure everybody runs the tests before a commit Sandra Castro