-
Notifications
You must be signed in to change notification settings - Fork 18
Fix invoke unit tests #1056
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
Fix invoke unit tests #1056
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes invoke unit tests in the datadog-agent repository by addressing dependency availability issues that arose after the multistage Dockerfile refactor in #1038.
- Bumps the
dda(datadog-agent-dev) version from v0.29.0 to v0.31.0 - Re-introduces the
DDA_NO_DYNAMIC_DEPS=1environment variable that was lost in the multistage refactor
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| linux/Dockerfile | Adds the DDA_NO_DYNAMIC_DEPS=1 environment variable to the final stage, restoring functionality needed for invoke unit tests |
| docker-bake.hcl | Updates the DDA_VERSION from v0.29.0 to v0.31.0 |
The changes are minimal and well-targeted. The PR correctly addresses the issue where invoke unit tests depend on httpx and binary packages that are only available because dda is installed in the root virtualenv. By setting DDA_NO_DYNAMIC_DEPS=1, dda will use the existing Python environment instead of managing its own, making these dependencies accessible to the tests.
The placement of the environment variable (line 380) is appropriate - it's grouped with other environment variables in the final stage after the Python environment has been copied from the python_builder stage (line 373).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
81fa219 to
617cd06
Compare
This is how it was before the refactor in #1038, and the invoke unit tests in `datadog-agent` rely on this behavior
617cd06 to
6e5d6ad
Compare
* feat(linux): Bump `dda` to `0.31.0` * fix(linux): Disable `dda` dynamic dependency management This is how it was before the refactor in #1038, and the invoke unit tests in `datadog-agent` rely on this behavior
* feat(linux): Bump `dda` to `0.31.0` * fix(linux): Disable `dda` dynamic dependency management This is how it was before the refactor in #1038, and the invoke unit tests in `datadog-agent` rely on this behavior Co-authored-by: Pierre-Louis Veyrenc <pierrelouis.veyrenc@datadoghq.com>
What does this PR do?
ddaincluded in the mainlinuximage to0.31.0DDA_NO_DYNAMIC_DEPSvariable that was in the previous buildimages before [ACIX-1056] Makelinux/Dockerfilemultistage #1038Motivation
The invoke unit tests in
datadog-agentactually rely on this variable being there:DDA_NO_DYNAMIC_DEPS=1,ddawill use whatever Python env it exists in to run commands instead of managing its own.httpxandbinary, which are not included in the normallegacy-tasksdependency group, but are dependencies ofddaitself.ddais installed in the "root" virtualenv in the buildimage, these two modules are de facto also available - this explains why the invoke task unit tests don't fail. Using a virtualenv with onlylegacy-taskswould not be sufficient as it does not containhttpxandbinaryeven though the tests rely on it.Possible Drawbacks / Trade-offs
Further masking of what we actually depend on in this monolith that is
datadog-agentCI...Additional Notes
Also see DataDog/datadog-agent-dev#234, including those deps so that they would be installed even without this
DDA_NO_DYNAMIC_DEPS=1