-
Notifications
You must be signed in to change notification settings - Fork 376
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, wouldn't this cause an import error (pytest will error rather than skip the tests)
@mpharrigan PTAL |
@@ -19,7 +19,7 @@ cd "$(git rev-parse --show-toplevel)" | |||
|
|||
PYTEST_ARGS=() | |||
ACTUALLY_QUIET="" | |||
for arg in $@; do | |||
for arg in "$@"; do |
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.
why is this changed? are you sure?
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.
$@ 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. |
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.
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.