Enable testing for resource estimates#828
Conversation
| pytest.skip('Need pyscf for resource estimates', allow_module_level=True) | ||
| HAVE_DEPS_FOR_RESOURCE_ESTIMATES = True | ||
| except ModuleNotFoundError: | ||
| HAVE_DEPS_FOR_RESOURCE_ESTIMATES = False |
There was a problem hiding this comment.
should we re-raise the exception with a helpful error message? presumably if these imports fail something else will give a weird error message when you actually go and try to use any of the functionality
There was a problem hiding this comment.
I don't think so, wouldn't this cause an import error (pytest will error rather than skip the tests)
|
@mpharrigan PTAL |
| PYTEST_ARGS=() | ||
| ACTUALLY_QUIET="" | ||
| for arg in $@; do | ||
| for arg in "$@"; do |
There was a problem hiding this comment.
why is this changed? are you sure?
There was a problem hiding this comment.
$@ splits quoted args on whitespace so the option -m "not slow" gets converted to '-m' 'not' 'slow', rather than '-m' 'not slow'. At least I couldn't figure out how to pass in quoted args otherwise. Happy to be schooled on bash though
|
the output from the ci job looks like the desired tests aren't being run (??) |
|
or is that a weird artifact of the runner? those test files aren't in |
|
very odd, I have no idea why it's giving those paths... |
|
Maybe to do with pytest saying the root_dir is dev_tools/conf, maybe I used the wrong command to specify the pytest.ini file. |
|
maybe that grep expression is doing something weird |
|
Nah the grep is quieting the output I think. I needed to pass --rootdir through to pytest, somehow specifying the pytest.ini file sets the rootdir to where the ini file is (dev_tools/conf). Should be fixed now. |
mpharrigan
left a comment
There was a problem hiding this comment.
still lgtm. Do reviews get disqualified if you post another commit? We should make that not happen
|
Seems like it needed a re-review. Thanks! |
Previously the resource estimation code was not being tested as part of the CI (#825) . This PR enables it, I've marked a few tests as slow and will open an issue to track the fact that one dependency (btas/pybtas) doesn't have any tests. I think we should add a weekly workflow which will run the slow tests and run a yet to be written pybtas unit test.
I'm only testing the resource estimate code for linux and mac as I don't think pyscf works on windows.