Skip to content

Separate slower running integration tests to run in parallel#117

Merged
eb8680 merged 5 commits intopyro-ppl:devfrom
neerajprad:travis_parallel_matrix
Sep 14, 2017
Merged

Separate slower running integration tests to run in parallel#117
eb8680 merged 5 commits intopyro-ppl:devfrom
neerajprad:travis_parallel_matrix

Conversation

@neerajprad
Copy link
Copy Markdown
Member

@neerajprad neerajprad commented Sep 13, 2017

Changes to .travis.yml:

  • As per discussion in [Do not merge] Run tests in parallel #116, separating the integration and unit tests so that they can be run in parallel in travis. Green unit tests should signify a certain degree of confidence in the PR even if the slow integration tests are still running.
  • Run the lint check before running tests in each group in the matrix, so that we can fail the build early if lint check fails. Note that despite the parallelization via matrix, a lot of our builds are typically waiting to get assigned to a worker (see fig. below for this PR, already waiting for more than 10 mins). As such, many a time we have expensive integration or unit tests running first, with the lint check job later failing. To get failure feedback as early as possible, we should fail a build if it fails lint checks (very fast) without running through the more expensive test suite. Unfortunately, I couldn't find a way to assign priority to builds in the matrix which would have been better - lint check > unit tests > integration tests.

screen shot 2017-09-13 at 3 41 15 pm

@eb8680 eb8680 self-requested a review September 13, 2017 22:05
@neerajprad neerajprad changed the title [Testing] Separate slower running integration tests to run in parallel Separate slower running integration tests to run in parallel Sep 13, 2017
Comment thread .travis.yml
- pip install torchvision

script:
- PYTHONPATH=$PWD:$PYTHONPATH pytest -s --cov=pyro
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I find the the -v flag helpful (or -vs) to see the name of each test as it is run.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nice. will make the change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

Comment thread .travis.yml Outdated

script:
- PYTHONPATH=$PWD:$PYTHONPATH pytest -s --cov=pyro
- flake8 && PYTHONPATH=$PWD:$PYTHONPATH pytest -s --cov=pyro tests/$TEST_DIRECTORY
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not just separate lines

script
    - flake8
    - pytest ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just updated in the description above. I think this will run the tests even if lint fails. Ideally, we should just mark the build as failed, and wait for the dev to fix this before running the expensive test suite. Thoughts?

@eb8680 eb8680 mentioned this pull request Sep 13, 2017
7 tasks
@neerajprad neerajprad requested a review from jpchen September 13, 2017 23:22
@neerajprad
Copy link
Copy Markdown
Member Author

The faster unit tests finish within 20 mins; and the longer integration tests are still running. There are still some statistical errors, which we should rectify in the unit tests, at least (not for this PR).

screen shot 2017-09-13 at 6 39 10 pm

@eb8680
Copy link
Copy Markdown
Member

eb8680 commented Sep 14, 2017

Unfortunately, I couldn't find a way to assign priority to builds in the matrix which would have been better - lint check > unit tests > integration tests.

Looks like Travis has a beta feature, Build Stages, that could be useful here.

@neerajprad
Copy link
Copy Markdown
Member Author

@eb8680 - will quickly try out the Build Stages feature.

@neerajprad
Copy link
Copy Markdown
Member Author

@eb8680 - This seems to work well. I think we can go with this and add more parallelization within each of the stages later. It will be great if we can finish off the fast testing (i.e. everything up to unit tests) within 10 minutes.

Copy link
Copy Markdown
Member

@eb8680 eb8680 left a comment

Choose a reason for hiding this comment

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

Nice work, LGTM

@neerajprad
Copy link
Copy Markdown
Member Author

@eb8680, @jpchen - can we get this merged into master? (also, please select 'squash and merge' when merging this, we do not need the intermediate commits)

@eb8680 eb8680 merged commit 8155f66 into pyro-ppl:dev Sep 14, 2017
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.

3 participants