Skip to content

Migrate squid tests to mock_http fixture#23555

Merged
mwdd146980 merged 1 commit intomwdd146980/httpx-migration-basefrom
mwdd146980/step5-squid
May 1, 2026
Merged

Migrate squid tests to mock_http fixture#23555
mwdd146980 merged 1 commit intomwdd146980/httpx-migration-basefrom
mwdd146980/step5-squid

Conversation

@mwdd146980
Copy link
Copy Markdown
Contributor

@mwdd146980 mwdd146980 commented Apr 30, 2026

Motivation

Test fixtures patching requests.Session.get will silently break when squid switches from requests to httpx. Migrate to mock_http fixture + MockHTTPResponse so tests are transport-agnostic.

Approach

  • Replace mock.patch('datadog_checks.squid.squid.requests.Session.get') with mock_http fixture in test_unit.py (3 tests).
  • Replace mock.patch('datadog_checks.base.utils.http.requests.Session.get') with mock_http fixture in test_squid.py::test_version_metadata.

Verification

ddev test -fs squid
ddev --no-interactive test squid

All unit tests pass. dd_environment-gated tests fail at fixture setup due to local Docker image pull (pre-existing, unrelated to this change).

@mwdd146980 mwdd146980 requested a review from a team as a code owner April 30, 2026 20:32
@mwdd146980 mwdd146980 marked this pull request as draft April 30, 2026 20:36
@datadog-prod-us1-3
Copy link
Copy Markdown

datadog-prod-us1-3 Bot commented Apr 30, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 100.00% (+12.73%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2dd0b0c | Docs | Datadog PR Page | Give us feedback!

@mwdd146980 mwdd146980 self-assigned this Apr 30, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.99%. Comparing base (610bb2b) to head (2dd0b0c).
⚠️ Report is 1 commits behind head on mwdd146980/httpx-migration-base.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mwdd146980
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@mwdd146980 mwdd146980 marked this pull request as ready for review April 30, 2026 21:10
Base automatically changed from mwdd146980/step4-conftest-session-patches to mwdd146980/httpx-migration-base May 1, 2026 15:59
@mwdd146980 mwdd146980 requested a review from a team as a code owner May 1, 2026 15:59
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 1, 2026

Validation Report

All 20 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and Codecov settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@mwdd146980 mwdd146980 merged commit faddc6c into mwdd146980/httpx-migration-base May 1, 2026
23 of 27 checks passed
@mwdd146980 mwdd146980 deleted the mwdd146980/step5-squid branch May 1, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants