-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First draft of tests on the ensemble_tools #23
Conversation
Ah yes this is going to be a pain. I think the root of the issue that There are a few routes we could go
Of these, (3) is I'd say the 'nicest' solution in terms of adhering to good practice but I suspect will be non-trivial to get done. I think for now (1) is probably the best option as it should hopefully be relatively simple to implement and I think is less brittle than (2). |
Agreed that (3) sounds ideal, but less immediately practical. I was trying to get something to work with (2), but couldn't work out how to get the right paths in the right places, and like you say it would have ended up very brittle either way. So I've put in a suppression for ImportError, that hopefully won't cause too many problems down the road? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dleggat this is looking good - I've made some suggestions about separating out some of the checks in to different test functions (generally tests which check one or a few related conditions rather than lots of logically distinct conditions are preferred from a perspective of failure in test reports then being more granular and helping to identify the specific issue needing to be addressed) and also in parameterizing some tests to cover a wide range of cases.
… method to return a tuple of matched and incorrect parameters found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dleggat for the updates. I've made a few small further suggestions but none are essential. I'll open issues for the points I made about factoring out some functions and adding unit tests for these.
Changing the `assert _check_parameter_in_conditions` statements to directly store the results into variables, and explicitly check them. For readability Co-authored-by: Matt Graham <matthew.m.graham@gmail.com>
…nd removed the check of None on parameter_to_scan
…n addition check to the tests for such an empty argument
A first draft of the tests for ensemble_tools.
The tests use /tmp/ to create dummy sweep directories with a range of templated parameters, and check the directory structure and xml output for validity.
The tests work with
pytest
, but do not currently run intox
. I get the following error:Which I'm assuming means something in the .toml needs to be changed to allow pytest access to the base fabsim classes, but adding in the fabsim pythonpath argument to the pytest init hook hasn't solved the problem as I hoped it would.
Resolves #12