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

Stop using the TOX_ENV_NAME variable #15528

Merged
merged 5 commits into from
Aug 10, 2023
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 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
Loading