Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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