Skip to content

Commit

Permalink
Stop using the TOX_ENV_NAME variable (#15528)
Browse files Browse the repository at this point in the history
* Stop using the TOX_ENV_NAME variable

* Nudge CI

* changelog

* changelog

* changelog
  • Loading branch information
FlorentClarret authored Aug 10, 2023
1 parent 642de26 commit 2719f7d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions datadog_checks_dev/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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***:
Expand Down
2 changes: 1 addition & 1 deletion datadog_checks_dev/datadog_checks/dev/plugin/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
4 changes: 1 addition & 3 deletions datadog_checks_dev/datadog_checks/dev/tooling/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
)
Expand Down
2 changes: 1 addition & 1 deletion datadog_checks_dev/datadog_checks/dev/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2719f7d

Please sign in to comment.