From 9d284551d178819d0f9fc8c41a96e39b6a620b94 Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Thu, 10 Aug 2023 08:54:01 +0200 Subject: [PATCH 1/5] Stop using the TOX_ENV_NAME variable --- datadog_checks_dev/datadog_checks/dev/plugin/pytest.py | 2 +- datadog_checks_dev/datadog_checks/dev/tooling/testing.py | 4 +--- datadog_checks_dev/datadog_checks/dev/utils.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/datadog_checks_dev/datadog_checks/dev/plugin/pytest.py b/datadog_checks_dev/datadog_checks/dev/plugin/pytest.py index 80745fbe81bf2..4cbdaefd6ab68 100644 --- a/datadog_checks_dev/datadog_checks/dev/plugin/pytest.py +++ b/datadog_checks_dev/datadog_checks/dev/plugin/pytest.py @@ -160,7 +160,7 @@ def run_check(config=None, **kwargs): root = new_root python_path = os.environ[E2E_PARENT_PYTHON] - env = os.environ.get('TOX_ENV_NAME') or os.environ['HATCH_ENV_ACTIVE'] + env = os.environ['HATCH_ENV_ACTIVE'] # TODO: switch to `ddev` when the old CLI is gone check_command = [python_path, '-m', 'datadog_checks.dev', 'env', 'check', check, env, '--json'] diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/testing.py b/datadog_checks_dev/datadog_checks/dev/tooling/testing.py index 1e360e48f2d1c..04853517f04c6 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/testing.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/testing.py @@ -553,9 +553,7 @@ def construct_pytest_options( # junit report file must contain the env name to handle multiple envs # $HATCH_ENV_ACTIVE is a Hatch injected variable # See https://hatch.pypa.io/latest/plugins/environment/reference/#hatch.env.plugin.interface.EnvironmentInterface.get_env_vars # noqa - # $TOX_ENV_NAME is a tox injected variable - # See https://tox.readthedocs.io/en/latest/config.html#injected-environment-variables - f' --junit-xml=.junit/test-{test_group}-$HATCH_ENV_ACTIVE$TOX_ENV_NAME.xml' + f' --junit-xml=.junit/test-{test_group}-$HATCH_ENV_ACTIVE.xml' # Junit test results class prefix f' --junit-prefix={check}' ) diff --git a/datadog_checks_dev/datadog_checks/dev/utils.py b/datadog_checks_dev/datadog_checks/dev/utils.py index 75f8cf2e6c755..0f093c0cb1dfc 100644 --- a/datadog_checks_dev/datadog_checks/dev/utils.py +++ b/datadog_checks_dev/datadog_checks/dev/utils.py @@ -27,7 +27,7 @@ def get_active_env(): - return os.environ.get('TOX_ENV_NAME') or os.environ['HATCH_ENV_ACTIVE'] + return os.environ['HATCH_ENV_ACTIVE'] def ensure_bytes(s): From 84e71badd9ad293dd8b19ceb86de737fb19d3b6a Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Thu, 10 Aug 2023 09:01:13 +0200 Subject: [PATCH 2/5] Nudge CI From 58cae499cdd6903d8e376898d668c57bbc7f414d Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Thu, 10 Aug 2023 09:03:23 +0200 Subject: [PATCH 3/5] changelog --- datadog_checks_dev/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datadog_checks_dev/CHANGELOG.md b/datadog_checks_dev/CHANGELOG.md index 55b420c9eccb7..80586dc5a12d9 100644 --- a/datadog_checks_dev/CHANGELOG.md +++ b/datadog_checks_dev/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +***Fixed***: + +* Stop using the TOX_ENV_NAME variable. See [#15528](https://github.com/DataDog/integrations-core/pull/15528). + ## 23.0.0 / 2023-08-10 ***Changed***: From 45a4a4d20e19156629a65595ceab3cec80aa713c Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Thu, 10 Aug 2023 16:55:24 +0200 Subject: [PATCH 4/5] changelog --- datadog_checks_dev/CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/datadog_checks_dev/CHANGELOG.md b/datadog_checks_dev/CHANGELOG.md index 80586dc5a12d9..55b420c9eccb7 100644 --- a/datadog_checks_dev/CHANGELOG.md +++ b/datadog_checks_dev/CHANGELOG.md @@ -2,10 +2,6 @@ ## Unreleased -***Fixed***: - -* Stop using the TOX_ENV_NAME variable. See [#15528](https://github.com/DataDog/integrations-core/pull/15528). - ## 23.0.0 / 2023-08-10 ***Changed***: From f3e3e2a4a573937df21a17c34a7afbec101cc613 Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Thu, 10 Aug 2023 17:04:28 +0200 Subject: [PATCH 5/5] changelog --- datadog_checks_dev/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datadog_checks_dev/CHANGELOG.md b/datadog_checks_dev/CHANGELOG.md index 55b420c9eccb7..dc55aed849566 100644 --- a/datadog_checks_dev/CHANGELOG.md +++ b/datadog_checks_dev/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +***Fixed***: + +* Stop using the TOX_ENV_NAME variable ([#15528](https://github.com/DataDog/integrations-core/pull/15528)) + ## 23.0.0 / 2023-08-10 ***Changed***: