Continuous integration tests
KPP contains several continuous integration (aka C-I) tests. Each C-I test calls KPP to generate source code for a given chemical mechanism, integrator, and target language, and then runs a short “box model” simulation with the generated code. C-I tests help to ensure that new features and updates added to KPP will not break any existing functionality.
C-I tests will run automatically as a GitHub Action when commits are pushed to the KPP Github repository, or when a new pull requests are opened. You may also run the integration tests locally on your own computer.
List of continuous integration tests
C-I test |
Language |
Model |
Integrator |
What it tests |
|---|---|---|---|---|
|
C |
small_strato |
runge_kutta |
|
|
C |
small_strato |
rosenbrock_adj |
|
|
C |
small_strato |
sdirk |
|
|
C |
small_strato |
sdirk_adj |
|
|
C |
small_strato |
rosenbrock |
|
|
Fortran90 |
carbon |
feuler |
|
|
Fortran90 |
small_strato |
rosenbrock |
|
|
Fortran90 |
small_strato |
lsode |
|
|
Fortran90 |
mcm |
rosenbrock |
Master Chemical Mechanism |
|
Fortran90 |
mcm |
rosenbrock_h211b_qssa |
|
|
Fortran90 |
saprc99 |
radau5 |
|
|
Fortran90 |
small_strato |
runge_kutta |
|
|
Fortran90 |
small_strato |
runge_kutta_adj |
|
|
Fortran90 |
small_strato |
runge_kutta_tlm |
|
|
Fortran90 |
small_strato |
rosenbrock |
|
|
Fortran90 |
small_strato |
rosenbrock_adj |
|
|
Fortran90 |
saprc99 |
rosenbrock_autoreduce |
|
|
Fortran90 |
saprc99 |
rosenbrock |
|
|
Fortran90 |
saprc99 |
rosenbrock_h211b_qssa |
|
|
Fortran90 |
small_strato |
rosenbrock |
Excluding passive species |
|
Fortran90 |
small_strato |
rosenbrock |
|
|
Fortran90 |
small_strato |
rosenbrock_tlm |
|
|
Fortran90 |
saprc99 |
rosenbrock |
|
|
Fortran90 |
saprcnov |
rosenbrock |
|
|
Fortran90 |
small_strato |
sdirk4 |
|
|
Fortran90 |
small_strato |
sdirk |
|
|
Fortran90 |
small_strato |
sdirk_adj |
|
|
Fortran90 |
small_strato |
sdirk_tlm |
|
|
Fortran90 |
saprcnov |
seulex |
|
|
Fortran90 |
small_strato |
rosenbrock |
|
|
Fortran90 |
small_strato |
runge_kutta |
Notes about C-I tests:
F90_ros_splituses #FUNCTION SPLIT.F90_ros_upcaseuses #UPPERCASEF90 ON.F90_small_stratois the example from Running KPP with an example stratospheric mechanism.X_minvertests if the #MINVERSION command works properly.
Each continuous integration test is contained in a subdirectory of
$KPP_HOME/ci-tests. In each subdirectory is a KPP definition
file (ending in .kpp).
Running continuous integration tests as a GitHub Action
The files needed to run the C-I tests are described below.
run-ci-tests.yml
Path: $KPP_HOME/.github/workflows/run-ci-tests.yml
Description: Configuration file with commands to download KPP, load libraries, and run the C-I tests as a GitHub Action.
C-I tests will run automatically when a commit is pushed to any branch at https://github.com/KineticPreProcessor/KPP, or when a new pull request is opened there. This is the recommended setting, but you can restrict this so that only pushes or pull requests to certain branches will trigger the C-I tests.
ci-testing-script.sh
Path: $KPP_HOME/.ci-pipelines/ci-testing-script.sh
Description: Runs the KPP C-I tests as a GitHub Action, or on a local computer system.
ci-cleanup-script.sh
Path: $KPP_HOME/.ci-pipelines/ci-cleanup-script.sh
Description: Removes compiler-generated files (e.g. *.o,
.mod , and .exe) from C-I test folders.
ci-common-defs.sh
Path: $KPP_HOME/.ci-pipelines/ci-common-defs.sh
Description Contains common variable and function definitions needed by ci-testing-script.sh and ci-cleanup-script.sh.
Running continuous integration tests locally
To run the C-I tests on a local computer system, use this command:
$ $KPP_HOME/.ci-pipelines/ci-testing-script.sh | tee ci-tests.log
This will run all C-I tests on your own computer system and pipe the results to a log file. This will easily allow you to check if the results of the C-I tests are identical to C-I tests that were run on a prior commit or pull request.
To remove the files generated by the continuous integration tests, use this command:
$ $KPP_HOME/.ci-pipelines/ci-cleanup-script.sh
If you add new C-I tests, be sure to add the name of the new tests to
the variable GENERAL_TESTS in ci-common-defs.sh.