CliMA / ClimateMachine.jl

Climate Machine: an Earth System Model that automatically learns from data
https://clima.github.io/ClimateMachine.jl/latest/
Other
452 stars 78 forks source link

CI tests for merges #1541

Open kpamnany opened 4 years ago

kpamnany commented 4 years ago

Description

This issue will be closed when we are satisfied that the CI tests for merges (not including daily or weekly tests) are both comprehensive and minimal. To this end, there must be sufficient unit tests for each ClimateMachine module, and a small set of integration tests.

Integration tests

A framework for model testing needs to be built to simplify integration testing and make our integration tests leaner. Please volunteer to lead/participate in this effort.

Unit tests

Below is a list of every module in the ClimateMachine with the checkbox indicating whether there are any unit tests specified for the module together with a note about its current testing state.

Please:

Modules

trontrytel commented 4 years ago

@kpamnany - Thank you for doing this.

For Microphysics.jl and Microphysics_0M.jl parameterisation modules the unit tests are in runtests.jl I think every parameterisation function has at least one unit test. The tests could be better, though.

The remaining tests use a 2D Kinematic Model setup. This was my attempt to test some of the microphysics separately from model dynamics issues. They are integration tests and are run on buildkite.

charleskawczynski commented 4 years ago

Should we start this by pulling out all files in test/ that rely on invoke!, and move them to (for example) integration_tests/, and see how codecov changes?

kmdeck commented 4 years ago

I checked the Land Box - currently for soil we have two files with true unit tests, and then the rest are integration tests. I think our unit tests could be improved, and possibly some things tested by the integration tests can be made into unit tests (for example, the test_bc and prescribed_twice files)

simonbyrne commented 4 years ago

One thing I would like to see is a test harness for balance laws to check fluxes, sources, boundary conditions etc at single points (i.e. without a DGModel)

kmdeck commented 4 years ago

One thing I would like to see is a test harness for balance laws to check fluxes, sources, boundary conditions etc at single points (i.e. without a DGModel)

this might let us get rid of our integration test test_bc.jl, as the only purpose of that is to test that the values at the boundary throughout the integration match (within some error) the values we supplied as conditions.

akshaysridhar commented 4 years ago

TurbulenceClosures is based on full experiment integration tests currently, but I will refactor those into smaller function-level checks.

kpamnany commented 4 years ago

I checked the Land Box - currently for soil we have two files with true unit tests, and then the rest are integration tests. I think our unit tests could be improved, and possibly some things tested by the integration tests can be made into unit tests (for example, the test_bc and prescribed_twice files)

@kmdeck: would you open an issue in which you describe these improvements to the unit tests? I'll link that issue here for tracking. No commitment is currently necessary on when those improvements will be carried out. :-)

jiahe23 commented 4 years ago

TurbulenceClosures is based on full experiment integration tests currently, but I will refactor those into smaller function-level checks.

I have been working on refactoring the hyperdiffusion box test and adding a spherical surface test. Primary modifications in the box test include:

There are still some issues with the spherical surface test and @mwarusz is digging into it.

Hope this is helpful, and let me know if there is anything I could help with!

charleskawczynski commented 4 years ago

I'll for sure cover

And I'll try to tac on more soon.

charleskawczynski commented 3 years ago

Reviewing CodeCov for the Thermodynamics module, it looks like most of the "missed" coverage is due to inlining. Hoping this will improve with fixes in Julia 1.6