Skip to content

Commit

Permalink
Speed up test suites by using a single virtual environment per Python…
Browse files Browse the repository at this point in the history
… version (DataDog#6789)

* Speed up test suites by using a single virtual environment per Python version

* workaround tox bug tox-dev/tox#1593

* test all integrations

* fix

* great

* address
  • Loading branch information
ofek authored Jun 3, 2020
1 parent 50f3bc2 commit 27e7f30
Show file tree
Hide file tree
Showing 139 changed files with 552 additions and 2 deletions.
4 changes: 4 additions & 0 deletions active_directory/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
usedevelop = true
platform = win32
Expand Down
3 changes: 3 additions & 0 deletions activemq/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ envlist =
py38

[testenv]
ensure_default_envdir = true
envdir =
py38: {toxworkdir}/py38
description =
py38: e2e ready
usedevelop = true
Expand Down
4 changes: 4 additions & 0 deletions activemq_xml/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
usedevelop = true
Expand Down
4 changes: 4 additions & 0 deletions aerospike/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
py{27,38}-{latest}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions airflow/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions amazon_msk/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
usedevelop = true
platform = linux|darwin|win32
Expand Down
4 changes: 4 additions & 0 deletions ambari/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
usedevelop = true
platform = linux|darwin|win32
Expand Down
4 changes: 4 additions & 0 deletions apache/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
usedevelop = true
Expand Down
4 changes: 4 additions & 0 deletions aspdotnet/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
usedevelop = true
platform = win32
Expand Down
4 changes: 4 additions & 0 deletions btrfs/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
usedevelop = true
dd_check_style = true
platform = linux|darwin
Expand Down
4 changes: 4 additions & 0 deletions cacti/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
usedevelop = true
Expand Down
3 changes: 3 additions & 0 deletions cassandra/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ envlist =
py38

[testenv]
ensure_default_envdir = true
envdir =
py38: {toxworkdir}/py38
description =
py38: e2e ready
usedevelop = true
Expand Down
4 changes: 4 additions & 0 deletions cassandra_nodetool/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}-{2.1,3.0}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions ceph/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions cilium/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
description =
py{27,38}: e2e ready
Expand Down
4 changes: 4 additions & 0 deletions cisco_aci/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
usedevelop = true
dd_check_style = true
deps =
Expand Down
4 changes: 4 additions & 0 deletions clickhouse/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
py{27,38}-{18,19,latest}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
description =
py{27,38}: e2e ready
Expand Down
4 changes: 4 additions & 0 deletions cockroachdb/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ envlist =
bench

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions confluent_platform/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py38: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions consul/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}-{0.6.4,0.7.2,1.0.0,1.0.6}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions coredns/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}-{1.2.0}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
description =
py{27,38}-{1.2.0}: e2e ready
Expand Down
4 changes: 4 additions & 0 deletions couch/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}-{1.6,2.3}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions couchbase/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}-{5.5.3}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions crio/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
usedevelop = true
platform = linux|darwin|win32
Expand Down
4 changes: 4 additions & 0 deletions datadog_checks_base/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
bench

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
dd_check_types = true
dd_mypy_args =
Expand Down
14 changes: 12 additions & 2 deletions datadog_checks_dev/datadog_checks/dev/plugin/tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
TYPES_FLAG = 'dd_check_types'
MYPY_ARGS_OPTION = 'dd_mypy_args'
E2E_READY_CONDITION = 'e2e ready if'
FIX_DEFAULT_ENVDIR_FLAG = 'ensure_default_envdir'


@tox.hookimpl
Expand All @@ -23,11 +24,12 @@ def tox_configure(config):
For an example, see: https://github.com/tox-dev/tox-travis
"""
sections = config._cfg.sections
base_testenv = sections.get('testenv', {})

# Default to false so:
# 1. we don't affect other projects using tox
# 2. check migrations can happen gradually
if str(sections.get('testenv', {}).get(STYLE_FLAG, 'false')).lower() == 'true':
if str(base_testenv.get(STYLE_FLAG, 'false')).lower() == 'true':
# Disable flake8 since we already include that
config.envlist[:] = [env for env in config.envlist if not env.endswith('flake8')]

Expand All @@ -37,8 +39,16 @@ def tox_configure(config):
add_style_checker(config, sections, make_envconfig, reader)
add_style_formatter(config, sections, make_envconfig, reader)

# Workaround for https://github.com/tox-dev/tox/issues/1593
#
# Do this only after all dynamic environments have been created
if str(base_testenv.get(FIX_DEFAULT_ENVDIR_FLAG, 'false')).lower() == 'true':
for env_name, env_config in config.envconfigs.items():
if env_config.envdir == config.toxinidir:
env_config.envdir = config.toxworkdir / env_name

# Conditionally set 'e2e ready' depending on env variables
description = sections.get('testenv', {}).get('description')
description = base_testenv.get('description')
if description and E2E_READY_CONDITION in description:
data, var = description.split(' if ')
if var in os.environ:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
py{{27,38}}

[testenv]
ensure_correct_envdir = true
envdir =
py27: {{toxworkdir}}/py27
py38: {{toxworkdir}}/py38
dd_check_style = true
usedevelop = true
platform = linux|darwin|win32
Expand Down
4 changes: 4 additions & 0 deletions datadog_checks_dev/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
dd_check_types = true
dd_mypy_args =
Expand Down
4 changes: 4 additions & 0 deletions datadog_checks_downloader/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
usedevelop = true
deps =
Expand Down
4 changes: 4 additions & 0 deletions directory/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ envlist =
bench

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description=
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions disk/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description =
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions dns_check/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
description=
py{27,38}: e2e ready
dd_check_style = true
Expand Down
4 changes: 4 additions & 0 deletions dotnetclr/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ envlist =
py{27,38}

[testenv]
ensure_default_envdir = true
envdir =
py27: {toxworkdir}/py27
py38: {toxworkdir}/py38
dd_check_style = true
usedevelop = true
platform = win32
Expand Down
Loading

0 comments on commit 27e7f30

Please sign in to comment.