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

remove mock allowances on nil objects #4295

Merged
merged 3 commits into from
Jan 16, 2025
Merged

remove mock allowances on nil objects #4295

merged 3 commits into from
Jan 16, 2025

Conversation

p-datadog
Copy link
Member

What does this PR do?

worker is nil and allow(worker) is a no-op that rspec complains about:

WARNING: An expectation of `:start` was set on `nil`. To allow expectations on `nil` and suppress this message, set `RSpec::Mocks.configuration.allow_message_expectations_on_nil` to `true`. To disallow expectations on `nil`, set `RSpec::Mocks.configuration.allow_message_expectations_on_nil` to `false`. Called from /home/w/apps/dd-trace-rb/spec/datadog/tracing/contrib/rack/integration_test_spec.rb:61:in 'block (4 levels) in <top (required)>'.
WARNING: An expectation of `:stop` was set on `nil`. To allow expectations on `nil` and suppress this message, set `RSpec::Mocks.configuration.allow_message_expectations_on_nil` to `true`. To disallow expectations on `nil`, set `RSpec::Mocks.configuration.allow_message_expectations_on_nil` to `false`. Called from /home/w/apps/dd-trace-rb/spec/datadog/tracing/contrib/rack/integration_test_spec.rb:62:in 'block (4 levels) in <top (required)>'.

This PR removes the allowances.

Motivation:

Reduce warnings in tests

Change log entry
None

Additional Notes:

How to test the change?

N/A

@p-datadog p-datadog requested a review from a team as a code owner January 15, 2025 21:43
@github-actions github-actions bot added the dev/testing Involves testing processes (e.g. RSpec) label Jan 15, 2025
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Jan 15, 2025

Datadog Report

Branch report: allow-on-nil
Commit report: 46cc0d4
Test service: dd-trace-rb

✅ 0 Failed, 22069 Passed, 1476 Skipped, 6m 1.68s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Jan 15, 2025

Benchmarks

Benchmark execution time: 2025-01-16 21:02:15

Comparing candidate commit 46cc0d4 in PR branch allow-on-nil with baseline commit 3d54001 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics.

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.71%. Comparing base (b5cf594) to head (46cc0d4).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4295      +/-   ##
==========================================
- Coverage   97.72%   97.71%   -0.01%     
==========================================
  Files        1358     1358              
  Lines       82503    82501       -2     
  Branches     4223     4223              
==========================================
- Hits        80622    80615       -7     
- Misses       1881     1886       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@p-datadog p-datadog merged commit 7e37aff into master Jan 16, 2025
378 checks passed
@p-datadog p-datadog deleted the allow-on-nil branch January 16, 2025 21:26
@github-actions github-actions bot added this to the 2.10.0 milestone Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/testing Involves testing processes (e.g. RSpec)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants