Add unit tests and continuous integration#3
Conversation
This is needed for tests
This helps with performing unit tests
|
Unfortunately, I don't think CI will run until after this goes in. |
Works locally for me at least. |
|
Hi, this looks like a good addition. I hopefully can look at it in more detail soon. But here already one top-level comment. |
|
Good call, @hgoelzer. I was struggling with |
1eca0bb to
6fab4ec
Compare
|
Tests aren't running here in the pull request yet but they are running on my fork: |
hgoelzer
left a comment
There was a problem hiding this comment.
Looks good and works for me. After running pytest I was wondering where the test netcdf files were and realised they are created on the fly and deleted again, in line with an automated test procedure. I've learned that the files can be retained and inspected by adding --basetemp to the call, like so
conda run -n isschecker pytest -v tests/test_compliance_checker.py --basetemp=/tmp/pytest_tmp
This could be added to the README for transparency, unless this is just my curiosity and not relevant for our standard use case. I leave that judgement up to you. Great to have this feature in. Thanks
Added instructions for retaining test files during pytest.
|
@hgoelzer, |
These tests require some small changes to the checker and the generator so it can run in a temp directory.
They test the different expected failure modes of the checker (as well as successes).
They should run automatically with pushes and pull requests.