Skip to content
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

Shard testprojects integration tests #4205

Merged

Conversation

stuhood
Copy link
Member

@stuhood stuhood commented Jan 25, 2017

Problem

See #4204: because all tests defined under testprojects are run in a single test method and pytest only outputs anything when a method has completed, travis began failing test runs due to lack of output. Additionally, when this test failed, your only recourse was to run the entire thing.

Solution

Split the test into "select targets to test" and "test them", and then shard the result N ways on a method-by-method basis. In theory this could have been done bash-wise in ci.sh... but frankly, I don't want to grow a bash script if I can avoid it.

Result

The test is now sharded N==8 ways.

Copy link
Contributor

@jsirois jsirois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Stu - seems like this will do fine.

@@ -4,16 +4,22 @@

from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import math
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this needs a blank line above between it and from __future__ ....

Copy link
Contributor

@JieGhost JieGhost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cheister
Copy link
Contributor

LGTM. Alternatively, is there a way to just make a test method for each testproject?

@stuhood stuhood merged commit 8da8fcf into pantsbuild:master Jan 25, 2017
@stuhood stuhood deleted the stuhood/shard-testprojects-integration branch January 25, 2017 19:13
jebbench added a commit to jebbench/pants that referenced this pull request Jan 25, 2017
Shard testprojects integration tests (pantsbuild#4205)
lenucksi pushed a commit to lenucksi/pants that referenced this pull request Apr 25, 2017
### Problem

See pantsbuild#4204: because all tests defined under testprojects are run in a single test method and pytest only outputs anything when a method has completed, travis began failing test runs due to lack of output. Additionally, when this test failed, your only recourse was to run the entire thing.

### Solution

Split the test into "select targets to test" and "test them", and then shard the result N ways on a method-by-method basis. In theory this could have been done bash-wise in `ci.sh`... but frankly, I don't want to grow a bash script if I can avoid it.

### Result

The test is now sharded `N==8` ways.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants