Skip to content

Commit

Permalink
fix: sonarlint duplicated lines
Browse files Browse the repository at this point in the history
Signed-off-by: Ladislav Macoun <ladislavmacoun@gmail.com>
  • Loading branch information
ladislavmacoun committed Jul 14, 2023
1 parent cca48f0 commit 963f3e9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/redpanda/redpanda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
"github.com/twmb/franz-go/pkg/sasl/scram"
)

var (
containerTerminationFailed = "failed to terminate container: %s"
)

func TestRedpanda(t *testing.T) {
ctx := context.Background()

Expand All @@ -24,7 +28,7 @@ func TestRedpanda(t *testing.T) {
// Clean up the container after the test is complete
t.Cleanup(func() {
if err := container.Terminate(ctx); err != nil {
t.Fatalf("failed to terminate container: %s", err)
t.Fatalf(containerTerminationFailed, err)
}
})

Expand Down Expand Up @@ -84,7 +88,7 @@ func TestRedpandaWithAuthentication(t *testing.T) {
// Clean up the container after the test is complete
t.Cleanup(func() {
if err := container.Terminate(ctx); err != nil {
t.Fatalf("failed to terminate container: %s", err)
t.Fatalf(containerTerminationFailed, err)
}
})

Expand Down Expand Up @@ -185,7 +189,7 @@ func TestRedpandaProduceUnknownTopic(t *testing.T) {

t.Cleanup(func() {
if err := container.Terminate(ctx); err != nil {
t.Fatalf("failed to terminate container: %s", err)
t.Fatalf(containerTerminationFailed, err)
}
})

Expand Down Expand Up @@ -218,7 +222,7 @@ func TestRedpandaProduceWithAutoCreateTopics(t *testing.T) {

t.Cleanup(func() {
if err := container.Terminate(ctx); err != nil {
t.Fatalf("failed to terminate container: %s", err)
t.Fatalf(containerTerminationFailed, err)
}
})

Expand Down

0 comments on commit 963f3e9

Please sign in to comment.