Skip to content

Conversation

JoseALermaIII
Copy link
Owner

@JoseALermaIII JoseALermaIII commented Oct 3, 2019

Summary

Refactors coveralls coverage as tox environment factors and implements them in Travis CI.

Description

Previously, #10 fixed the integration between Travis CI and Coveralls; however, updating Coveralls coverage still ran repetitive tests. This costs about 35 seconds of build time per build.

Further digging in tox's config settings revealed conditional settings.

The idea is to make coverage a conditional setting of the py37 tox environment, which Coveralls will update after_success. This way, Coveralls coverage will get updated only after running the py37-coverage environment instead of after every environment.

By doing this, Coveralls should be updated during py37 unit tests instead of running a second set of unit tests to update Coveralls. In theory, this should save around 35 seconds of build time.

While I was at it, I added coverage reports to the coverage testenv. This environment is intended to run locally as a testing tool rather than in a CI build.

Team Notifications

Me, myself, and I

@JoseALermaIII JoseALermaIII added the enhancement New feature or request label Oct 3, 2019
@JoseALermaIII JoseALermaIII self-assigned this Oct 3, 2019
@JoseALermaIII
Copy link
Owner Author

Hmm, even though coverage isn't generated, Coveralls still gets updated. Looks like this method won't work with Coveralls.

For now, I'll keep thinking of ways to recoup that build time.

@JoseALermaIII
Copy link
Owner Author

I suppose splitting the py36 environment doesn't reduce Coveralls reports at all. This is so counter-intuitive:

This build, Travis build 49, had 5 jobs and ran for 2min 56sec while still reporting to Coveralls 4x. To add to that time, job 49.2 ran unit tests twice - once by default and again for coverage.

The last build on master, Travis build 42, had 6 jobs and ran for 2min 40sec, but only reported to Coveralls once. Technically speaking, unit tests ran twice, but as separate jobs. Looks like splitting the jobs and parallel processing is what saved 16 seconds.

Looks like putting coveralls in after_success will always force a coverage update - regardless of whether or not coverage data was created.

I don't think this can go any further.

@JoseALermaIII JoseALermaIII deleted the improve-tox-travis branch October 4, 2019 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant