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 go-require #5983

Merged
merged 1 commit into from
Sep 15, 2024

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
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
@@ -385,7 +385,7 @@ func TestClientCreateAliases(t *testing.T) {
assert.Equal(t, http.MethodPost, req.Method)
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

@@ -501,7 +501,7 @@ func TestGetErrorRatesZero(t *testing.T) {
defer r.Body.Close()

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... ?

@@ -354,10 +354,10 @@ func testPasswordFromFile(t *testing.T, f *Factory, getClient func() es.Client,
t.Logf("request to fake ES server: %v", r)
// epecting header in the form Authorization:[Basic OmZpcnN0IHBhc3N3b3Jk]
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?

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
@yurishkuro yurishkuro merged commit 8d1a955 into jaegertracing:main Sep 15, 2024
48 of 49 checks passed
@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