vendredi 17 mai 2019

Is it possible to run breadth first instead of depth first in tox?

I have a suite of small tests that take about 40 seconds in total to run, and I have a suite of medium tests that take about 40 minutes in total to run.

I would love the ordering to run like this:

  1. py27 small tests
  2. py37 small tests
  3. py27 medium tests
  4. py37 medium tests

Instead, tox runs it like

  1. py27 small tests
  2. py27 medium tests
  3. py37 small tests
  4. py37 medium tests

The problem with this is if something simple breaks a small test, I want to know about it immediately. The medium tests (like integration tests) are an extra layer of security that can smoke out more issues but take a much longer time to run through.

[tox]
envlist = py27,py37
[testenv:py27]
deps =
    pytest
    pytest-cov
    pytest-mock
    pylint
    ; packages specified by the setup.py cover the other dependencies for py2.7
commands =
    pytest -v --ignore-glob="*medium*" --doctest-modules
    pytest -v tests/medium_tests 

Aucun commentaire:

Enregistrer un commentaire