[pull] master from DataDog:master#638
Merged
Merged
Conversation
* Add unbounded option to EventBusOrchestrator * Add changelog entry * Nest __resolve_max_timeout on unbounded * Remove unbounded flag. Make max_timeout=None be the unbounded trigger * Remove test
…ot (#23765) * Use absolute paths for in-core editable installs in hatch env collector The post-install command emitted by the ddev environment collector referenced datadog_checks_base/dev with relative paths (`../...`), which only resolved correctly when hatch happened to run the command with CWD == integration root. Hatch <=1.9 silently cd'd into the project root before running scripts; hatch 1.10+ preserves the invocation CWD, so invoking hatch from a subdirectory (e.g. `tests/lab/`) caused the install to look for the dependencies under that subdirectory and fail with "Distribution not found". Anchor both installs to `self.root.parent` (the integrations-core checkout directory, determined by hatch via pyproject.toml lookup), so the install commands work regardless of the hatch version or the CWD hatch was invoked from. * Add changelog entry for #23765 * Anchor ruff config and mypy config paths to the project root Both `ruff_settings_dir` and the typing-script's `mypy --config-file` relied on relative paths (`./pyproject.toml`, `..`, `../pyproject.toml`) resolved from the invocation CWD. They had the same CWD-sensitivity class of bug as the editable-install paths fixed earlier in this PR and break the same way on hatch 1.10+ when invoked from a subdirectory. Anchor them to `self.root` (the integration root, resolved by hatch via pyproject.toml walk-up) so the emitted commands are stable. Also add a regression suite for `format_base_package`, `base_package_install_command`, `test_package_install_command`, and `ruff_settings_dir` covering both the in-core (absolute path) and non-core (PyPI package name) branches. * Mark hatch env collector tests as a package and harden the install test - Add __init__.py to the new ddev/tests/plugin/external/hatch/ subtree to match the convention used by every other ddev/tests/ subdir and avoid future filename collisions under pytest's default import mode. - Clear DDEV_TEST_BASE_PACKAGE_VERSION in the in-core install test so a leaked env var can't short-circuit into the version branch and fail the assertion for a reason unrelated to path anchoring. - Use pytest.param(id=...) on the format_base_package parametrize for self-describing test IDs. * Derive local-path test expectations from the input for Windows portability The two local_path parametrize cases hardcoded POSIX-style expected strings, but format_base_package returns str(local_path), which renders with backslashes on Windows. The ddev test target runs on windows-2022 in CI, so the equality assertion would fail there. Build the expected string with an f-string over the same Path input. * Quote absolute editable/config paths cross-platform in generated hatch scripts Hatch runs post-install and lint/typing scripts with shell=True, so an absolute checkout path containing whitespace (e.g. /Users/Jane Doe or C:\Users\Jane Doe) was word-split before uv/ruff/mypy received it. shlex.quote only produces POSIX quoting, which cmd.exe ignores, so add a shell_quote helper that double-quotes on Windows and uses shlex.quote elsewhere, applied at each path interpolation site. * Extract a fake_checkout fixture to dedupe whitespace-checkout test setup Merges the plain/whitespace variants of the base and test package install command tests into single parametrized tests, and reuses the fixture for the ruff settings dir and lint command tests. * Fix Windows CI failures in environment collector tests Pin sys.platform and use PurePosixPath in test_format_base_package so the raw-string assertion isn't broken by shlex.quote wrapping backslash-laden WindowsPath strings in quotes on a Windows host. Also fix the expected lint config path to match the separator each underlying code path actually produces (forced '/' for ruff, native join for mypy). --------- Co-authored-by: Alexey Pilyugin <alexey.pilyugin@datadoghq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )