Skip to content

Commit

Permalink
Do not modify the agent build name if provided by the user when runni…
Browse files Browse the repository at this point in the history
…ng the e2e environments
  • Loading branch information
FlorentClarret committed Oct 19, 2023
1 parent 8a0d3f0 commit 381a51d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
4 changes: 4 additions & 0 deletions ddev/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

* Improve the upgrade-python script ([#16000](https://github.com/DataDog/integrations-core/pull/16000))

***Fixed***:

* Do not modify the agent build name if provided by the user when running the e2e environments ([#16052](https://github.com/DataDog/integrations-core/pull/16052))

## 5.2.1 / 2023-10-12

***Fixed***:
Expand Down
22 changes: 11 additions & 11 deletions ddev/src/ddev/e2e/agent/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ def start(self, *, agent_build: str, local_packages: dict[Path, str], env_vars:
if not agent_build:
agent_build = 'datadog/agent-dev:master'

# Add a potentially missing `py` suffix for default non-RC builds
if (
'rc' not in agent_build
and 'py' not in agent_build
and agent_build != 'datadog/agent:6'
and agent_build != 'datadog/agent:7'
):
agent_build = f'{agent_build}-py{self.python_version[0]}'

if self.metadata.get('use_jmx') and not agent_build.endswith('-jmx'):
agent_build += '-jmx'
# Add a potentially missing `py` suffix for default non-RC builds
if (
'rc' not in agent_build
and 'py' not in agent_build
and agent_build != 'datadog/agent:6'
and agent_build != 'datadog/agent:7'
):
agent_build = f'{agent_build}-py{self.python_version[0]}'

if self.metadata.get('use_jmx') and not agent_build.endswith('-jmx'):
agent_build += '-jmx'

env_vars = env_vars.copy()

Expand Down
7 changes: 3 additions & 4 deletions ddev/tests/e2e/agent/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ class TestStart:
'agent_build, agent_image, use_jmx',
[
pytest.param('', 'datadog/agent-dev:master-py3', False, id='default'),
pytest.param('datadog/agent:7', 'datadog/agent:7', False, id='release'),
pytest.param('datadog/agent-dev:master-py3', 'datadog/agent-dev:master-py3', False, id='exact'),
pytest.param('datadog/agent-dev:master', 'datadog/agent-dev:master-py3-jmx', True, id='jmx'),
pytest.param('datadog/agent-dev:master-py3-jmx', 'datadog/agent-dev:master-py3-jmx', True, id='jmx exact'),
pytest.param('', 'datadog/agent-dev:master-py3-jmx', True, id='jmx'),
pytest.param('my-custom-build-that-I-have-locally', 'my-custom-build-that-I-have-locally', False, id='custom build'),
pytest.param('my-custom-build-that-I-have-locally', 'my-custom-build-that-I-have-locally', True, id='custom build with jmx'),
],
)
def test_agent_build(
Expand Down

0 comments on commit 381a51d

Please sign in to comment.