Skip to content

Conversation

@mmorel-35
Copy link
Contributor

Which problem is this PR solving?

  • Apply go-require rule of testifylint

Description of the changes

  • More appropriate testify API with clearer failure message.

How was this change tested?

  • CI

Checklist

@mmorel-35 mmorel-35 requested a review from a team as a code owner September 14, 2024 17:02
@codecov
Copy link

codecov bot commented Sep 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.78%. Comparing base (55d330b) to head (6425bfd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/agent/app/testutils/mock_grpc_collector.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5983   +/-   ##
=======================================
  Coverage   96.78%   96.78%           
=======================================
  Files         348      348           
  Lines       16559    16559           
=======================================
  Hits        16027    16027           
  Misses        343      343           
  Partials      189      189           
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.84% <ø> (+0.01%) ⬆️
elasticsearch-8.x-v1 19.04% <ø> (+0.01%) ⬆️
elasticsearch-8.x-v2 1.81% <ø> (ø)
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% <ø> (ø)
opensearch-2.x-v1 18.89% <ø> (ø)
opensearch-2.x-v2 1.82% <ø> (+0.01%) ⬆️
tailsampling-processor 0.46% <ø> (ø)
unittests 95.27% <0.00%> (ø)

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.

@yurishkuro yurishkuro added the changelog:ci Change related to continuous integration / testing label Sep 14, 2024
@mmorel-35 mmorel-35 force-pushed the testifylint/go-require branch from a866dd6 to 8b128cf Compare September 15, 2024 07:37
assert.Equal(t, "Basic foobar", req.Header.Get("Authorization"))
body, err := io.ReadAll(req.Body)
require.NoError(t, err)
assert.NoError(t, err)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this should be used as if condition before using body in the next line


u, err := url.Parse("http://" + r.Host + r.RequestURI + "?" + string(body))
require.NoError(t, err)
assert.NoError(t, err)
Copy link
Member

Choose a reason for hiding this comment

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

If assert... ?

h := strings.Split(r.Header.Get("Authorization"), " ")
require.Len(t, h, 2)
require.Equal(t, "Basic", h[0])
assert.Len(t, h, 2)
Copy link
Member

Choose a reason for hiding this comment

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

If not this then return?

@mmorel-35 mmorel-35 force-pushed the testifylint/go-require branch from 8b128cf to e515315 Compare September 15, 2024 16:42
Signed-off-by: Matthieu MOREL <[email protected]>
@mmorel-35 mmorel-35 force-pushed the testifylint/go-require branch from e515315 to 6425bfd Compare September 15, 2024 16:53
@yurishkuro yurishkuro merged commit 8d1a955 into jaegertracing:main Sep 15, 2024
@mmorel-35 mmorel-35 deleted the testifylint/go-require branch September 15, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:ci Change related to continuous integration / testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants