Skip to content

Migrate mock_http fixture and test files to MockHTTPResponse#23300

Closed
mwdd146980 wants to merge 1 commit intomwdd146980/base-http-modulesfrom
mwdd146980/httpx-migration-remaining
Closed

Migrate mock_http fixture and test files to MockHTTPResponse#23300
mwdd146980 wants to merge 1 commit intomwdd146980/base-http-modulesfrom
mwdd146980/httpx-migration-remaining

Conversation

@mwdd146980
Copy link
Copy Markdown
Contributor

What does this PR do?

Remaining changes from the httpx migration feature branch (#22676), split out from the base modules PR (mwdd146980/base-http-modules).

Includes:

  • mock_http fixture in datadog_checks_dev (pytest plugin)
  • AgentCheck.http property update for mock_http support
  • MockResponse → MockHTTPResponse migration across ~40 test files
  • vault and traefik_mesh production code updates
  • OpenMetrics scraper updates for http_protocol compatibility

Motivation

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 bot commented Apr 13, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Other Violations

🧪 1 Test failed

test_e2e_snmp_listener from test_e2e_snmp_listener.py   View in Datadog   (Fix with Cursor)
Needed at least 1 candidates for 'datadog.snmp.check_duration', got 0
Expected:
        MetricStub(name='datadog.snmp.check_duration', type=0, value=None, tags=['autodiscovery_subnet:172.18.0.0/28', 'device_vendor:apc', 'firmware_version:2.0.3-test', 'loader:python', 'model:APC Smart-UPS 600', 'serial_num:test_serial', 'snmp_device:172.18.0.1', 'snmp_profile:apc_ups', 'ups_name:testIdentName'], hostname=None, device=None, flush_first_value=None)
Difference to closest:
        Expected tag snmp_device:172.18.0.1
        Found snmp_device:172.18.0.2

Similar submitted:
Score   Most similar
1.00    MetricStub(name='datadog.snmp.check_duration', type=0, value=0.2171943187713623, tags=['autodiscovery_subnet:172.18.0.0/28', 'device_vendor:apc', 'firmware_version:2.0.3-test', 'loader:python', 'model:APC Smart-UPS 600', 'serial_num:test_serial', 'snmp_device:172.18.0.2', 'snmp_profile:apc_ups', 'ups_name:testIdentName'], hostname='runnervmtxuyr', device=None, flush_first_value=False)
...

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 98.30%
Overall Coverage: 87.04% (+0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5039185 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 98.29545% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.59%. Comparing base (6686cd3) to head (5039185).

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 mwdd146980 force-pushed the mwdd146980/httpx-migration-remaining branch from 97cfa0b to 40893ee Compare April 13, 2026 20:13
@dd-octo-sts dd-octo-sts bot removed the dev_package label Apr 13, 2026
@mwdd146980 mwdd146980 force-pushed the mwdd146980/base-http-modules branch from f2eaf69 to 6686cd3 Compare April 13, 2026 20:47
Remaining changes from the httpx migration feature branch (#22676),
split out from the base modules PR (#23299).

Includes:
- mock_http fixture in datadog_checks_dev (pytest plugin)
- test_mock_http_patches_agentcheck test (depends on mock_http)
- AgentCheck.http property update for mock_http support
- MockResponse → MockHTTPResponse migration across ~40 test files
- vault and traefik_mesh production code updates
- OpenMetrics scraper updates for http_protocol compatibility

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mwdd146980 mwdd146980 force-pushed the mwdd146980/httpx-migration-remaining branch from 40893ee to 5039185 Compare April 13, 2026 20:48
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts bot commented Apr 13, 2026

Validation Report

Validation Status
agent-reqs
ci
codeowners
config
dep
http
imports
integration-style
jmx-metrics
labeler
legacy-signature
license-headers
licenses
metadata
models
openmetrics
package
readmes
saved-views
version

View full run

Copy link
Copy Markdown
Contributor Author

mwdd146980 commented Apr 14, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment