GeezerVison is showing github.com — Speed up umbrella tox -e cover by dhermes · Pull Request #2500 · googleapis/google-cloud-python
Conversation
dhermes
commented
Oct 5, 2016
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
This took a lot of wrangling, but eventually I found a solution: make unit_tests a namespace package and then collect from site-packages. This way we only run py.test once instead of 15 times, a huge speedup.
In order to do this I needed to do some renames to avoid collisions (e.g. unit_tests.test_client would have been installed for every sub-package).
The first 3 (of 4 of 5) commits are for the rename. The first two are automated (i.e. I didn't make changes to any files myself) and the third is just a tiny lint cleanup based on the automated changes.
Also relevant: https://testrun.org/tox/latest/example/pytest.html#known-issues-and-limitations
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
daspecster reacted with hooray emoji
Done via:
$ git grep -l 'from unit_tests._fixtures import' -- vision |
> xargs sed -i s/'from unit_tests._fixtures import'/'from unit_tests.vision._fixtures import'/g
$
$ git grep -l 'from unit_tests._fixtures import' -- speech |
> xargs sed -i s/'from unit_tests._fixtures import'/'from unit_tests.speech._fixtures import'/g
$
$ git grep -l 'from unit_tests._testing import ' -- bigtable |
> xargs sed -i s/'from unit_tests._testing import '/'from unit_tests.bigtable._testing import '/g
dhermes
commented
Oct 5, 2016
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
@tseaver The Travis failure is due to #2486. The change needed to filter for files that exist.
candidates, _ = get_affected_files()
python_files = [
candidate for candidate in candidates
if candidate.endswith('.py') and os.path.exists(candidate)]
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
unit_tests/handlers/transports/__init__.py → bigquery/unit_tests/bigquery/__init__.py, that doesn't seem right does it?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
python_files = [
|
|
|
candidate for candidate in candidates if candidate.endswith('.py')]
|
|
|
candidate for candidate in candidates
|
|
|
if candidate.endswith('.py') and os.path.exists(candidate)]
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I'm grinding my teeth about the issues caused from moving the unit tests out-of-tree: I still think they belong there, which would remove the need to mess with the unittests/ pseudo-package at all.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
So from a selfish standpoint, I like having the unit_tests for a package in the package. It makes for less mental tracking while working on things. Might just be me though.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@daspecster RE:
unit_tests/handlers/transports/__init__.py → bigquery/unit_tests/bigquery/__init__.py, that doesn't seem right does it?
That is just git not really caring where the file went. The __init__.py files are all identical
|
daspecster reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|