-
Notifications
You must be signed in to change notification settings - Fork 52
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
MAINT - Mock out call to env solve in test_generate_constructor_installer
#833
MAINT - Mock out call to env solve in test_generate_constructor_installer
#833
Conversation
✅ Deploy Preview for conda-store ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
d2eaf00
to
f5dbc52
Compare
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 @peytondmurray, I had a quick look and this looks good to me, at least from a logic POV.
I do want, however @jaimergp to have a quick look into this just in case there is something missing but otherwise I will go ahead and approve.
Also this PR needs updating as it has some merge conflicts @peytondmurray |
The mocking is solid here and lgtm. As a side note, I think we are dealing with a symptom of something bigger: why are we running the solver for constructor? Don't we have a lockfile at this point? I think constructor will still create the environment locally even if passed an explicit lockfile, but if we do have a solved environment, the environment itself can also be used as the input, which is a bit more accurate in terms of bundling what we want to bundle. |
The CI is failing, so I re-ran this in case it was a flaky test run.
Ideally, we should have a |
Hmmm, still failing - per the logs, there is something iffy trying to find |
Yep, this isn't a flaky test, it's a bad mock - the mock target changed since merging the privatization PR; should be fixed now. |
I'm not sure exactly how this would work; this action takes a specification (i.e. a python object representing an The only thing this new test does is parameterize some specifications and some lockfiles, pass them to the underlying action, and mock out the subprocess call to |
Partially addresses #830.
Description
Currently,
test_generate_constructor_installer
accounts for 64% of the time spent on unit tests ofconda-store-server
. This is because the test checks whether specifications can be built into individual installers usingconstructor
, which in turn asksconda
to downloadrepodata.json
and solve the environment, which takes a long time and is susceptible to network disruptions. I don't think it's actually necessary for us to solve the environment each time here, since we're not interested in testingconda
(orconstructor
) in this test.This pull request modifies the test to still produce the input files needed to call
constructor
, but then mocks out the call toconstructor
itself, avoiding the environment solve entirely. Some simple checks of the call toconstructor
are made instead, and some quick verification of the files that are meant to be used as input are made using internalconstructor
functions.Other changes
Pull request checklist