Regression tests in
1
D. Eldon/OMFIT code camp/2019-11-11
Regression tests in OMFIT
Outline
2
D. Eldon/OMFIT code camp/2019-11-11
Regression tests in OMFIT
Outline
3
D. Eldon/OMFIT code camp/2019-11-11
Write regression tests for scripts in OMFIT to detect problems with proposed changes
4
D. Eldon/OMFIT code camp/2019-11-11
Regression tests in OMFIT
Outline
5
D. Eldon/OMFIT code camp/2019-11-11
Regression test kept in OMFIT-source/regression/
& loaded with convenient GUI
OMFIT has a bunch of tests in this regression/ folder
...
6
D. Eldon/OMFIT code camp/2019-11-11
Regression test kept in OMFIT-source/regression/
& loaded with convenient GUI
Regression scripts can be loaded to the tree with a GUI accessed from OMFIT’s “File” menu
type filter here
7
D. Eldon/OMFIT code camp/2019-11-11
Regression tests can also be run from the command line
omfit regression/test_template.py
...
8
D. Eldon/OMFIT code camp/2019-11-11
Regression tests in OMFIT
Outline
9
D. Eldon/OMFIT code camp/2019-11-11
The OMFITtest class is for helping organize and communicate test results
OMFITtest reporting options:
10
D. Eldon/OMFIT code camp/2019-11-11
The OMFITtest class is for helping organize and communicate test results
11
D. Eldon/OMFIT code camp/2019-11-11
The OMFITtest class is for helping organize and communicate test results
12
D. Eldon/OMFIT code camp/2019-11-11
The OMFITtest class is for helping organize and communicate test results
13
D. Eldon/OMFIT code camp/2019-11-11
The OMFITtest class is for helping organize and communicate test results
14
D. Eldon/OMFIT code camp/2019-11-11
OMFITtest settings are written in the top of the class
notify_gh_status
Turns on/off GitHub status updates for the class itself
gh_individual_status
concerns status updates for test methods within the class
0: no status posts for methods
1: status posts for methods
2: status posts only for failed test methods
15
D. Eldon/OMFIT code camp/2019-11-11
OMFITtest settings are written in the top of the class
modules_to_load
The test class will load modules under OMFIT and append _test_copy to the key name
16
D. Eldon/OMFIT code camp/2019-11-11
OMFITtest settings are written in the top of the class
Other testing data
You can define variables for general use in the test, like a device and shot to use by default for most tests.
These are accessed as attributes of self
17
D. Eldon/OMFIT code camp/2019-11-11
Further examples of OMFITtest usage
18
D. Eldon/OMFIT code camp/2019-11-11
Regression tests in OMFIT
Outline
19
D. Eldon/OMFIT code camp/2019-11-11
OMFITtest can post GitHub status updates
Status options:
20
D. Eldon/OMFIT code camp/2019-11-11
Required checks help protect the repository from new bugs
21
D. Eldon/OMFIT code camp/2019-11-11
The Macmini Omfit Regression Test Invigilator (morti) runs some tests automatically
22
D. Eldon/OMFIT code camp/2019-11-11
Regression tests in OMFIT
Outline
23
D. Eldon/OMFIT code camp/2019-11-11
Tests that focus on small units of code make finding errors easier
24
D. Eldon/OMFIT code camp/2019-11-11
Regression tests in OMFIT
Outline
25
D. Eldon/OMFIT code camp/2019-11-11
assert is the best statement for tests
26
D. Eldon/OMFIT code camp/2019-11-11
assert is the best statement for tests
27
D. Eldon/OMFIT code camp/2019-11-11
Recommendations for regression testing
28
D. Eldon/OMFIT code camp/2019-11-11