Repository navigation
Improved standardised testing suite - #86
irm-codebase wants to merge 3 commits into
Conversation
jnnr
left a comment
There was a problem hiding this comment.
Thanks for this, @irm-codebase! I left some minor comments.
I think that more guidelines for developers should be added to the README; on where to place additional tests (tests/unit, tests/integration (?)), what they can alter (tests/unit/, tests/modelblocks/integration/module_integration_test.py) and where to leave their hands off (tests/modelblocks/convention_test.py). There could be a convention test that enforces the latter.
Shall we add a directory tests/integration for more integration tests? Some modules already have some local performance tests, for example.
- Removed check for figures/module.png - Small docstring fix in the README.md of the generated module
|
@jnnr about the testing guidance, I agree. I was thinking that maybe the following should be added:
Does this sound like a good idea? |
|
I agree on tests/README.md. In summary, we'd have the following. Even if tests/workflow is optional, I would provide an empty folder and state it in the README description of the template. |
Agreed @jnnr ! I'll implement this in the next commit. |
Fixes #85
Separates standard Modelblocks checks from module unit tests and sunsets the old
test/integration_test.pyfile in favour of more targeted test separation.tests/modelblocks/, which is now fully managed by the template.convention_test.py: validates that files and behaviour specified in the Modelblocks convention.module_integration_test.py: tests emulating importing the module into another workflow live here.tests/unit/, coupled with a newpixi run test-unittask. It lets you run unit tests onworkflow/scripts/*.pycode.unit-test) which extends themoduleenvironment, resolved in tandem with it..github/workflows/pr-ci.yml. It will fail by default (to force people to add at least a couple of unit tests).conftest.pyis seen by the template, which is quite minimal).copierrules related to these changes.copier update.If this is accepted, I'll submit a sister PR to the docs specifying the new testing method.