Tox: detox: Have some level of non-concurrency.

Created on 17 Sep 2016  路  5Comments  路  Source: tox-dev/tox

I have a really nice workflow for managing coverage testing using tox: I have an envlist that looks something like:

clean,{py27,py33,py34,pypy}-django{17,18},status

The first listed environment simply removes the existing coverage data, and the final one runs the coverage status reports.

The issue is that with detox, the env status runs before any of the other envs have had a chance to finish.

I'd love some way of either marking that a specific env should _not_ run under detox (as it gives an error that no coverage data was found), or should run after everything else.

The only workaround I have come up with is to remove the status env from the envlist, and run tox -e status after detox.

commands-execution configuration new medium

Most helpful comment

@hpk42 if tox gains the concept of dependent pipelines, it will basically be a serverless ci server ^^

All 5 comments

I had the same issue. What I did was to add a testenv called "detox" that would run detox -e all_envs_except_coverage_report and then tox -e coverage_report.

I can now run tox -e detox.
If it is not listed in [tox] itself then you can still run tox normally.

An example:

[tox]
envlist =
    clean,
    check,
    {py27,py34,py35}-django-18,
    {py27,py34,py35}-django-19,
    {py27,py34,py35}-django-110,
    report
    ; note detox is not listed here

[testenv]
commands = coverage run runtests.py
basepython =
    pypy: {env:TOXPYTHON:pypy}
    {py27,detox}: {env:TOXPYTHON:python2.7}
    py33: {env:TOXPYTHON:python3.3}
    py34: {env:TOXPYTHON:python3.4}
    py35: {env:TOXPYTHON:python3.5}
    {clean,check,report}: python3.5

[testenv:report]
deps = coverage
skip_install = true
commands =
    coverage combine --append
    coverage report
    coverage html

[testenv:detox]
skip_install = true
deps = detox
commands =
    detox -e clean,check,py27-django-18,py27-django-19,py27-django-110,py35-django-18,py35-django-19,py35-django-110
    tox -e report

@hpk42 if tox gains the concept of dependent pipelines, it will basically be a serverless ci server ^^

One solution could be to add a parallel = false option to [testenv] and use groupby to collect groups based on the option. Each group would run synchronously, but each job in the group would run synchronously or in parallel based on the group's parallel flag.

FWIW, we made this kind of mistake when writing Twisted's tox.ini as well. https://twistedmatrix.com/trac/ticket/9164

Kamino closed and cloned this issue to tox-dev/detox

Was this page helpful?
0 / 5 - 0 ratings