Skip to content
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

Detect WebMock to disable telemetry and remote configuration #3065

Merged
merged 9 commits into from
Sep 5, 2023

Conversation

TonyCTHsu
Copy link
Contributor

@TonyCTHsu TonyCTHsu commented Aug 22, 2023

What does this PR do?

It has been reported by the community that ddtrace is breaking test suite with WebMock, since some components are sending http request in the background with net/http .

Hence this PR make an effort the detect WebMock to provide a better default value for ddtrace telemetry and remote configuration.

WebMock does not offer an public API such as WebMock.enabled? to check the status. When WebMock.enable!, it iterates through http adapters to enable them. The net/http adapter implements enablement by swapping the reference for Net::HTTP

@github-actions github-actions bot added the core Involves Datadog core libraries label Aug 22, 2023
@TonyCTHsu TonyCTHsu added this to the 1.14.0 milestone Aug 22, 2023
@TonyCTHsu TonyCTHsu marked this pull request as ready for review August 22, 2023 12:23
@TonyCTHsu TonyCTHsu requested a review from a team August 22, 2023 12:23
@TonyCTHsu TonyCTHsu removed this from the 1.14.0 milestone Aug 23, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #3065 (188f7db) into master (737db7b) will decrease coverage by 0.01%.
Report is 34 commits behind head on master.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3065      +/-   ##
==========================================
- Coverage   98.15%   98.15%   -0.01%     
==========================================
  Files        1323     1323              
  Lines       75089    75134      +45     
  Branches     3424     3424              
==========================================
+ Hits        73704    73746      +42     
- Misses       1385     1388       +3     
Files Changed Coverage Δ
lib/datadog/core/environment/execution.rb 100.00% <100.00%> (ø)
spec/datadog/core/environment/execution_spec.rb 95.45% <100.00%> (+3.96%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@TonyCTHsu TonyCTHsu merged commit a3f113e into master Sep 5, 2023
204 checks passed
@TonyCTHsu TonyCTHsu deleted the tonycthsu/webmock-detection branch September 5, 2023 19:03
@github-actions github-actions bot added this to the 1.15.0 milestone Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants