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

testifylint: enable float-compare #5989

Merged
merged 1 commit into from
Sep 15, 2024

Conversation

mmorel-35
Copy link
Contributor

Which problem is this PR solving?

  • Apply float-compare rule of testifylint

Description of the changes

  • More appropriate testify API with clearer failure message.

How was this change tested?

  • CI

Checklist

Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.81%. Comparing base (0824fc2) to head (47f5ab3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5989      +/-   ##
==========================================
- Coverage   96.82%   96.81%   -0.02%     
==========================================
  Files         345      345              
  Lines       16523    16523              
==========================================
- Hits        15998    15996       -2     
- Misses        339      340       +1     
- Partials      186      187       +1     
Flag Coverage Δ
badger_v1 8.02% <ø> (ø)
badger_v2 1.82% <ø> (ø)
cassandra-4.x-v1 16.61% <ø> (ø)
cassandra-4.x-v2 1.75% <ø> (ø)
cassandra-5.x-v1 16.61% <ø> (ø)
cassandra-5.x-v2 1.75% <ø> (ø)
elasticsearch-6.x-v1 18.77% <ø> (-0.02%) ⬇️
elasticsearch-7.x-v1 18.83% <ø> (ø)
elasticsearch-8.x-v1 19.02% <ø> (-0.02%) ⬇️
elasticsearch-8.x-v2 1.82% <ø> (ø)
grpc_v1 9.52% <ø> (ø)
grpc_v2 7.15% <ø> (ø)
kafka-v1 9.74% <ø> (ø)
kafka-v2 1.82% <ø> (ø)
memory_v2 1.82% <ø> (ø)
opensearch-1.x-v1 18.89% <ø> (+0.01%) ⬆️
opensearch-2.x-v1 18.89% <ø> (ø)
opensearch-2.x-v2 1.81% <ø> (ø)
tailsampling-processor 0.46% <ø> (ø)
unittests 95.29% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@mmorel-35 mmorel-35 force-pushed the testifylint/float-compare branch 3 times, most recently from d5c2cfe to 57d95f3 Compare September 15, 2024 09:25
@@ -258,10 +258,10 @@ func TestMissingServiceSamplingStrategyTypes(t *testing.T) {

require.NotNil(t, s.OperationSampling)
os := s.OperationSampling
assert.EqualValues(t, defaultSamplingProbability, os.DefaultSamplingProbability)
assert.InEpsilon(t, defaultSamplingProbability, os.DefaultSamplingProbability, 0.0001)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference vs inDelta?

Copy link
Contributor Author

@mmorel-35 mmorel-35 Sep 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There interfaces are quite similar I’m not sure but in my experience they both work the same way except that InEpsilon doesn’t work for a 0 expected value.

I would say that InEpsilon is for very small numbers but I don’t see anything prevising what a small number is.

I’ll keep InDelta instead

@yurishkuro yurishkuro added the changelog:test Change that's adding missing tests or correcting existing tests label Sep 15, 2024
@mmorel-35 mmorel-35 force-pushed the testifylint/float-compare branch 4 times, most recently from 4006fba to cd04c53 Compare September 15, 2024 10:04
@mmorel-35 mmorel-35 marked this pull request as ready for review September 15, 2024 10:07
@mmorel-35 mmorel-35 requested a review from a team as a code owner September 15, 2024 10:07
@dosubot dosubot bot added the enhancement label Sep 15, 2024
@yurishkuro yurishkuro merged commit da039e8 into jaegertracing:main Sep 15, 2024
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:test Change that's adding missing tests or correcting existing tests enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants