Top Banner
CASA Test System
14

CASA Test System

Jan 01, 2016

Download

Documents

bruce-brewer

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 - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CASA Test System

CASA Test System

Page 2: 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

Page 3: CASA Test System

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

Page 4: CASA Test System

e2e Tests

April 20, 2023 Sandra Castro 4

Page 5: CASA Test System

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

Page 6: CASA Test System

List of Python unit tests

April 20, 2023 Sandra Castro 6

They are located in: code/xmlcasa/scripts/tests

Page 7: CASA Test System

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

Page 8: CASA Test System

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

Page 9: CASA Test System

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.

Page 10: CASA Test System

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

Page 11: CASA Test System

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

Page 12: CASA Test System

Recent catches

April 20, 2023 Sandra Castro 12

Page 13: CASA Test System

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

Page 14: CASA Test System

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

April 20, 2023 Sandra Castro 14