Skip to content
This repository was archived by the owner on Mar 27, 2019. It is now read-only.

WIP: Clone Project and run jedi locally on it #47

Open
wants to merge 45 commits into
base: master
Choose a base branch
from

Conversation

ggilmore
Copy link
Contributor

@ggilmore ggilmore commented Mar 1, 2018

No description provided.

@keegancsmith
Copy link
Member

@ggilmore I've been trying to just speed up test_jedi.py. It seems we do pipenv twice for jedi, effectively doubling the time it takes. I assume that is related to subprojects.

----------------------------------------------------------------------------- Captured log teardown ------------------------------------------------------------------------------
workspace.py               221 INFO     Removing project's virtual environment /Users/keegan/.local/share/virtualenvs/init_extension_module-_7tEleXj
workspace.py               224 INFO     Removing cloned project cache /Users/keegan/src/github.com/sourcegraph/python-langserver/test/python-cloned-projects-cache/github.com.davidhalter.jedi.9f61554c-a65d-4910-b921-70ef9438d47e/test/test_evaluate/init_extension_module
workspace.py               221 INFO     Removing project's virtual environment /Users/keegan/.local/share/virtualenvs/github.com.davidhalter.jedi.9f61554c-a65d--ACUveBg4
workspace.py               224 INFO     Removing cloned project cache /Users/keegan/src/github.com/sourcegraph/python-langserver/test/python-cloned-projects-cache/github.com.davidhalter.jedi.9f61554c-a65d-4910-b921-70ef9438d47e

I updated pytest to enable better log capturing.

At first I was worried that we had to shell out to pipenv for every language server interaction (ie each hover), but that seems to be incorrect. So it seems most of the slowness is in setting up and tearing down the fixture. Can I propose we add an optional "fast" mode which avoids teardown and reuses the virtualenv per fixture. I think that should make the test suite much faster.

@ggilmore
Copy link
Contributor Author

ggilmore commented Mar 16, 2018 via email

@ggilmore
Copy link
Contributor Author

And yes, two virtual environments are created because there is a subproject in the tests for the jedi repo.

@ggilmore
Copy link
Contributor Author

Re-subprojects:

The current strategy is just to go through the entire workspace looking for installation files - and to assume that their presence indicates that there is a subproject that starts at that folder level. We create virtual environments for each subproject.

This logic doesn't work off the bat with some simple test cases that I wrote (not sure why atm). Given that, I think that it's fine to revert b17dae2 if it makes things easier.

@keegancsmith
Copy link
Member

yup, just on CI sounds good to me. FYI the CI envar var being non-empty is a mostly universal indication you are on CI.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants