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

Increase codecov of pkg/kafka #5682

Merged
merged 37 commits into from
Jul 3, 2024
Merged

Conversation

hellspawn679
Copy link
Contributor

Which problem is this PR solving?

Description of the changes

  • added test case for pkg/kafka/auth/config.go and updated internal/tracegen/worker_test.go

How was this change tested?

Checklist

@hellspawn679 hellspawn679 requested a review from a team as a code owner June 27, 2024 07:52
@hellspawn679 hellspawn679 requested a review from joe-elliott June 27, 2024 07:52
Copy link

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.88%. Comparing base (1b4f355) to head (e7a0875).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5682      +/-   ##
==========================================
+ Coverage   96.42%   96.88%   +0.45%     
==========================================
  Files         334      334              
  Lines       16144    16144              
==========================================
+ Hits        15567    15641      +74     
+ Misses        402      334      -68     
+ Partials      175      169       -6     
Flag Coverage Δ
badger_v1 8.06% <ø> (ø)
badger_v2 1.90% <ø> (ø)
cassandra-3.x-v1 16.63% <ø> (ø)
cassandra-3.x-v2 1.82% <ø> (ø)
cassandra-4.x-v1 16.63% <ø> (ø)
cassandra-4.x-v2 1.82% <ø> (ø)
elasticsearch-7.x-v1 18.86% <ø> (ø)
elasticsearch-8.x-v1 19.06% <ø> (+0.01%) ⬆️
elasticsearch-8.x-v2 19.06% <ø> (ø)
grpc_v1 9.46% <ø> (ø)
grpc_v2 7.41% <ø> (ø)
kafka 9.75% <ø> (ø)
opensearch-1.x-v1 18.91% <ø> (+0.01%) ⬆️
opensearch-2.x-v1 18.90% <ø> (ø)
opensearch-2.x-v2 18.91% <ø> (+0.01%) ⬆️
unittests 95.27% <ø> (+1.05%) ⬆️

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.

Signed-off-by: mehul gautam <[email protected]>
@yurishkuro yurishkuro added the changelog:test Change that's adding missing tests or correcting existing tests label Jun 27, 2024
Signed-off-by: mehul gautam <[email protected]>
mehul gautam and others added 5 commits June 28, 2024 17:06
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
mehul gautam and others added 2 commits June 30, 2024 17:38
pkg/kafka/auth/tls.go Outdated Show resolved Hide resolved
mehul gautam added 2 commits June 30, 2024 18:36
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
@hellspawn679 hellspawn679 changed the title Increase codecov Increase codecov of pkg/kafka Jun 30, 2024
@hellspawn679 hellspawn679 requested a review from yurishkuro June 30, 2024 19:20
mehul gautam and others added 2 commits July 1, 2024 06:15
pkg/kafka/auth/config_test.go Outdated Show resolved Hide resolved
Comment on lines 98 to 105
"--kafka.auth.kerberos.service-name=kafka",
"--kafka.auth.kerberos.realm=EXAMPLE.COM",
"--kafka.auth.kerberos.use-keytab=true",
"--kafka.auth.kerberos.username=user",
"--kafka.auth.kerberos.password=password",
"--kafka.auth.kerberos.config-file=/path/to/krb5.conf",
"--kafka.auth.kerberos.keytab-file=/path/to/keytab",
"--kafka.auth.kerberos.disable-fast-negotiation=true",
Copy link
Member

Choose a reason for hiding this comment

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

is kerberos relevant to this test? the tests should use minimal amount of settings required to reproduce the scenario

Copy link
Member

Choose a reason for hiding this comment

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

If you are testing different permutations of settings, it's better to make this table-driven and include only the right amount of settings for each use case

pkg/kafka/auth/config_test.go Outdated Show resolved Hide resolved
pkg/kafka/auth/config_test.go Outdated Show resolved Hide resolved
pkg/kafka/auth/config_test.go Outdated Show resolved Hide resolved
pkg/kafka/consumer/config_test.go Outdated Show resolved Hide resolved
pkg/kafka/producer/config_test.go Outdated Show resolved Hide resolved
mehul gautam and others added 2 commits July 2, 2024 10:09
@hellspawn679 hellspawn679 requested a review from yurishkuro July 2, 2024 12:03
tlsConfig := &tlscfg.Options{
Enabled: true,
}
defer tlsConfig.Close()
Copy link
Member

Choose a reason for hiding this comment

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

this should be after the call to setTLSConfiguration and error check. At this point you just created a struct, there can be no goroutine leak yet.

expectedMechanism sarama.SASLMechanism
}{
{
name: "SCRAM-SHA-256",
Copy link
Member

Choose a reason for hiding this comment

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

name field is redundant, you can use config.Mechanism instead

mehul gautam added 2 commits July 3, 2024 05:55
@hellspawn679 hellspawn679 requested a review from yurishkuro July 3, 2024 05:57
@yurishkuro yurishkuro merged commit b39252c into jaegertracing:main Jul 3, 2024
41 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants