Skip to content

Commit

Permalink
chore: make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainMuller committed Dec 23, 2024
1 parent 41f8721 commit a371785
Show file tree
Hide file tree
Showing 61 changed files with 169 additions and 169 deletions.
4 changes: 2 additions & 2 deletions _integration-tests/tests/99designs.gqlgen/gqlgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ type TestCase struct {
server *handler.Server
}

func (tc *TestCase) Setup(*testing.T, context.Context) {
func (tc *TestCase) Setup(context.Context, *testing.T) {
schema := graph.NewExecutableSchema(graph.Config{Resolvers: &graph.Resolver{}})
tc.server = handler.New(schema)
tc.server.AddTransport(transport.POST{})
}

func (tc *TestCase) Run(t *testing.T, _ context.Context) {
func (tc *TestCase) Run(_ context.Context, t *testing.T) {
c := client.New(tc.server)

const (
Expand Down
4 changes: 2 additions & 2 deletions _integration-tests/tests/aws.v1/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type TestCase struct {
cfg *aws.Config
}

func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
func (tc *TestCase) Setup(_ context.Context, t *testing.T) {
utils.SkipIfProviderIsNotHealthy(t)

server, host, port := utils.StartDynamoDBTestContainer(t)
Expand All @@ -40,7 +40,7 @@ func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
}
}

func (tc *TestCase) Run(t *testing.T, _ context.Context) {
func (tc *TestCase) Run(_ context.Context, t *testing.T) {
ddb := dynamodb.New(session.Must(session.NewSession(tc.cfg)))
_, err := ddb.ListTables(nil)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions _integration-tests/tests/aws.v2/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ type base struct {
port string
}

func (b *base) setup(t *testing.T, _ context.Context) {
func (b *base) setup(_ context.Context, t *testing.T) {
utils.SkipIfProviderIsNotHealthy(t)

b.server, b.host, b.port = utils.StartDynamoDBTestContainer(t)
}

func (b *base) run(t *testing.T, ctx context.Context) {
func (b *base) run(ctx context.Context, t *testing.T) {
ddb := dynamodb.NewFromConfig(b.cfg)
_, err := ddb.ListTables(ctx, nil)
require.NoError(t, err)
Expand Down
8 changes: 4 additions & 4 deletions _integration-tests/tests/aws.v2/load_default_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ type TestCaseLoadDefaultConfig struct {
base
}

func (tc *TestCaseLoadDefaultConfig) Setup(t *testing.T, ctx context.Context) {
tc.setup(t, ctx)
func (tc *TestCaseLoadDefaultConfig) Setup(ctx context.Context, t *testing.T) {
tc.setup(ctx, t)

cfg, err := config.LoadDefaultConfig(ctx,
config.WithRegion("test-region-1337"),
Expand All @@ -35,8 +35,8 @@ func (tc *TestCaseLoadDefaultConfig) Setup(t *testing.T, ctx context.Context) {
tc.cfg = cfg
}

func (tc *TestCaseLoadDefaultConfig) Run(t *testing.T, ctx context.Context) {
tc.base.run(t, ctx)
func (tc *TestCaseLoadDefaultConfig) Run(ctx context.Context, t *testing.T) {
tc.base.run(ctx, t)
}

func (tc *TestCaseLoadDefaultConfig) ExpectedTraces() trace.Traces {
Expand Down
8 changes: 4 additions & 4 deletions _integration-tests/tests/aws.v2/new_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type TestCaseNewConfig struct {
base
}

func (tc *TestCaseNewConfig) Setup(t *testing.T, ctx context.Context) {
tc.setup(t, ctx)
func (tc *TestCaseNewConfig) Setup(ctx context.Context, t *testing.T) {
tc.setup(ctx, t)

cfg := aws.NewConfig()
cfg.Region = "test-region-1337"
Expand All @@ -31,8 +31,8 @@ func (tc *TestCaseNewConfig) Setup(t *testing.T, ctx context.Context) {
tc.cfg = *cfg
}

func (tc *TestCaseNewConfig) Run(t *testing.T, ctx context.Context) {
tc.base.run(t, ctx)
func (tc *TestCaseNewConfig) Run(ctx context.Context, t *testing.T) {
tc.base.run(ctx, t)
}

func (tc *TestCaseNewConfig) ExpectedTraces() trace.Traces {
Expand Down
8 changes: 4 additions & 4 deletions _integration-tests/tests/aws.v2/struct_literal.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type TestCaseStructLiteral struct {
base
}

func (tc *TestCaseStructLiteral) Setup(t *testing.T, ctx context.Context) {
tc.setup(t, ctx)
func (tc *TestCaseStructLiteral) Setup(ctx context.Context, t *testing.T) {
tc.setup(ctx, t)

tc.cfg = aws.Config{
Region: "test-region-1337",
Expand All @@ -31,8 +31,8 @@ func (tc *TestCaseStructLiteral) Setup(t *testing.T, ctx context.Context) {
}
}

func (tc *TestCaseStructLiteral) Run(t *testing.T, ctx context.Context) {
tc.base.run(t, ctx)
func (tc *TestCaseStructLiteral) Run(ctx context.Context, t *testing.T) {
tc.base.run(ctx, t)
}

func (tc *TestCaseStructLiteral) ExpectedTraces() trace.Traces {
Expand Down
8 changes: 4 additions & 4 deletions _integration-tests/tests/aws.v2/struct_literal_ptr.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type TestCaseStructLiteralPtr struct {
base
}

func (tc *TestCaseStructLiteralPtr) Setup(t *testing.T, ctx context.Context) {
tc.setup(t, ctx)
func (tc *TestCaseStructLiteralPtr) Setup(ctx context.Context, t *testing.T) {
tc.setup(ctx, t)

cfg := &aws.Config{
Region: "test-region-1337",
Expand All @@ -32,8 +32,8 @@ func (tc *TestCaseStructLiteralPtr) Setup(t *testing.T, ctx context.Context) {
tc.cfg = *cfg
}

func (tc *TestCaseStructLiteralPtr) Run(t *testing.T, ctx context.Context) {
tc.base.run(t, ctx)
func (tc *TestCaseStructLiteralPtr) Run(ctx context.Context, t *testing.T) {
tc.base.run(ctx, t)
}

func (tc *TestCaseStructLiteralPtr) ExpectedTraces() trace.Traces {
Expand Down
4 changes: 2 additions & 2 deletions _integration-tests/tests/chi.v5/chi.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type TestCase struct {
*http.Server
}

func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
func (tc *TestCase) Setup(_ context.Context, t *testing.T) {
router := chi.NewRouter()

tc.Server = &http.Server{
Expand All @@ -46,7 +46,7 @@ func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
})
}

func (tc *TestCase) Run(t *testing.T, _ context.Context) {
func (tc *TestCase) Run(_ context.Context, t *testing.T) {
resp, err := http.Get(fmt.Sprintf("http://%s/", tc.Server.Addr))
require.NoError(t, err)
require.Equal(t, http.StatusOK, resp.StatusCode)
Expand Down
8 changes: 4 additions & 4 deletions _integration-tests/tests/confluent-kafka-go.v1/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ type TestCase struct {
addr []string
}

func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
func (tc *TestCase) Setup(_ context.Context, t *testing.T) {
utils.SkipIfProviderIsNotHealthy(t)
container, addr := utils.StartKafkaTestContainer(t)
tc.container = container
tc.addr = []string{addr}
}

func (tc *TestCase) Run(t *testing.T, ctx context.Context) {
func (tc *TestCase) Run(ctx context.Context, t *testing.T) {
tc.produceMessage(t)
tc.consumeMessage(t, ctx)
tc.consumeMessage(ctx, t)
}

func (tc *TestCase) kafkaBootstrapServers() string {
Expand Down Expand Up @@ -76,7 +76,7 @@ func (tc *TestCase) produceMessage(t *testing.T) {
require.NoError(t, err, "failed to send message")
}

func (tc *TestCase) consumeMessage(t *testing.T, ctx context.Context) {
func (tc *TestCase) consumeMessage(ctx context.Context, t *testing.T) {
t.Helper()

cfg := &kafka.ConfigMap{
Expand Down
8 changes: 4 additions & 4 deletions _integration-tests/tests/confluent-kafka-go.v2/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ type TestCase struct {
addr []string
}

func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
func (tc *TestCase) Setup(_ context.Context, t *testing.T) {
utils.SkipIfProviderIsNotHealthy(t)
container, addr := utils.StartKafkaTestContainer(t)
tc.container = container
tc.addr = []string{addr}
}

func (tc *TestCase) Run(t *testing.T, ctx context.Context) {
func (tc *TestCase) Run(ctx context.Context, t *testing.T) {
tc.produceMessage(t)
tc.consumeMessage(t, ctx)
tc.consumeMessage(ctx, t)
}

func (tc *TestCase) kafkaBootstrapServers() string {
Expand Down Expand Up @@ -76,7 +76,7 @@ func (tc *TestCase) produceMessage(t *testing.T) {
require.NoError(t, err, "failed to send message")
}

func (tc *TestCase) consumeMessage(t *testing.T, ctx context.Context) {
func (tc *TestCase) consumeMessage(ctx context.Context, t *testing.T) {
t.Helper()

cfg := &kafka.ConfigMap{
Expand Down
4 changes: 2 additions & 2 deletions _integration-tests/tests/dd-span/ddspan.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (

type TestCase struct{}

func (*TestCase) Setup(*testing.T, context.Context) {}
func (*TestCase) Setup(context.Context, *testing.T) {}

func (*TestCase) Run(t *testing.T, ctx context.Context) {
func (*TestCase) Run(ctx context.Context, t *testing.T) {
span, ctx := tracer.StartSpanFromContext(ctx, "test.root")
defer span.Finish()

Expand Down
4 changes: 2 additions & 2 deletions _integration-tests/tests/echo.v4/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type TestCase struct {
addr string
}

func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
func (tc *TestCase) Setup(_ context.Context, t *testing.T) {
tc.Echo = echo.New()
tc.Echo.Logger.SetOutput(io.Discard)

Expand All @@ -44,7 +44,7 @@ func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
})
}

func (tc *TestCase) Run(t *testing.T, _ context.Context) {
func (tc *TestCase) Run(_ context.Context, t *testing.T) {
resp, err := http.Get("http://" + tc.addr + "/ping")
require.NoError(t, err)
require.Equal(t, http.StatusOK, resp.StatusCode)
Expand Down
4 changes: 2 additions & 2 deletions _integration-tests/tests/fiber.v2/fiber.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type TestCase struct {
addr string
}

func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
func (tc *TestCase) Setup(_ context.Context, t *testing.T) {
tc.App = fiber.New(fiber.Config{DisableStartupMessage: true})
tc.App.Get("/ping", func(c *fiber.Ctx) error { return c.JSON(map[string]any{"message": "pong"}) })
tc.addr = "127.0.0.1:" + utils.GetFreePort(t)
Expand All @@ -36,7 +36,7 @@ func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
})
}

func (tc *TestCase) Run(t *testing.T, _ context.Context) {
func (tc *TestCase) Run(_ context.Context, t *testing.T) {
resp, err := http.Get("http://" + tc.addr + "/ping")
require.NoError(t, err)
require.Equal(t, http.StatusOK, resp.StatusCode)
Expand Down
12 changes: 6 additions & 6 deletions _integration-tests/tests/gcp_pubsub/gcp_pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type TestCase struct {
messageID string
}

func (tc *TestCase) Setup(t *testing.T, ctx context.Context) {
func (tc *TestCase) Setup(ctx context.Context, t *testing.T) {
utils.SkipIfProviderIsNotHealthy(t)

var err error
Expand Down Expand Up @@ -70,7 +70,7 @@ func (tc *TestCase) Setup(t *testing.T, ctx context.Context) {
require.NoError(t, err)
}

func (tc *TestCase) publishMessage(t *testing.T, ctx context.Context) {
func (tc *TestCase) publishMessage(ctx context.Context, t *testing.T) {
t.Helper()

topic := tc.client.Topic(testTopic)
Expand All @@ -84,7 +84,7 @@ func (tc *TestCase) publishMessage(t *testing.T, ctx context.Context) {
t.Log("finished publishing result", id)
}

func (tc *TestCase) receiveMessage(t *testing.T, ctx context.Context) {
func (tc *TestCase) receiveMessage(ctx context.Context, t *testing.T) {
t.Helper()

sub := tc.client.Subscription(testSubscription)
Expand All @@ -100,9 +100,9 @@ func (tc *TestCase) receiveMessage(t *testing.T, ctx context.Context) {
require.NotErrorIs(t, ctx.Err(), context.DeadlineExceeded)
}

func (tc *TestCase) Run(t *testing.T, ctx context.Context) {
tc.publishMessage(t, ctx)
tc.receiveMessage(t, ctx)
func (tc *TestCase) Run(ctx context.Context, t *testing.T) {
tc.publishMessage(ctx, t)
tc.receiveMessage(ctx, t)
}

func (tc *TestCase) ExpectedTraces() trace.Traces {
Expand Down
4 changes: 2 additions & 2 deletions _integration-tests/tests/gin/gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type TestCase struct {
*http.Server
}

func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
func (tc *TestCase) Setup(_ context.Context, t *testing.T) {
gin.SetMode(gin.ReleaseMode) // Silence start-up logging
engine := gin.New()

Expand All @@ -44,7 +44,7 @@ func (tc *TestCase) Setup(t *testing.T, _ context.Context) {
})
}

func (tc *TestCase) Run(t *testing.T, _ context.Context) {
func (tc *TestCase) Run(_ context.Context, t *testing.T) {
resp, err := http.Get("http://" + tc.Server.Addr + "/ping")
require.NoError(t, err)
require.Equal(t, http.StatusOK, resp.StatusCode)
Expand Down
4 changes: 2 additions & 2 deletions _integration-tests/tests/go-elasticsearch/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type base struct {
client esClient
}

func (b *base) Setup(t *testing.T, ctx context.Context, image string, newClient func(addr string, caCert []byte) (esClient, error)) {
func (b *base) Setup(ctx context.Context, t *testing.T, image string, newClient func(addr string, caCert []byte) (esClient, error)) {
utils.SkipIfProviderIsNotHealthy(t)

var err error
Expand All @@ -51,7 +51,7 @@ func (b *base) Setup(t *testing.T, ctx context.Context, image string, newClient
require.NoError(t, err)
}

func (b *base) Run(t *testing.T, ctx context.Context, doRequest func(t *testing.T, client esClient, body io.Reader)) {
func (b *base) Run(ctx context.Context, t *testing.T, doRequest func(t *testing.T, client esClient, body io.Reader)) {
span, ctx := tracer.StartSpanFromContext(ctx, "test.root")
defer span.Finish()

Expand Down
8 changes: 4 additions & 4 deletions _integration-tests/tests/go-elasticsearch/v6.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ type TestCaseV6 struct {
base
}

func (tc *TestCaseV6) Setup(t *testing.T, ctx context.Context) {
func (tc *TestCaseV6) Setup(ctx context.Context, t *testing.T) {
// skip test if CI runner os arch is not amd64
if _, ok := os.LookupEnv("CI"); ok && runtime.GOOS == "linux" && runtime.GOARCH != "amd64" {
t.Skip("Skipping test as the official elasticsearch v6 docker image only supports amd64")
} else if runtime.GOOS == "darwin" && runtime.GOARCH != "amd64" {
t.Skip("Skipping test as the official elasticsearch v6 docker image cannot run under rosetta")
}
tc.base.Setup(t, ctx, "docker.elastic.co/elasticsearch/elasticsearch:6.8.23", func(addr string, _ []byte) (esClient, error) {
tc.base.Setup(ctx, t, "docker.elastic.co/elasticsearch/elasticsearch:6.8.23", func(addr string, _ []byte) (esClient, error) {
return elasticsearch.NewClient(elasticsearch.Config{
Addresses: []string{addr},
})
})
}

func (tc *TestCaseV6) Run(t *testing.T, ctx context.Context) {
tc.base.Run(t, ctx, func(t *testing.T, client esClient, body io.Reader) {
func (tc *TestCaseV6) Run(ctx context.Context, t *testing.T) {
tc.base.Run(ctx, t, func(t *testing.T, client esClient, body io.Reader) {
t.Helper()
req := esapi.IndexRequest{
Index: "test",
Expand Down
8 changes: 4 additions & 4 deletions _integration-tests/tests/go-elasticsearch/v7.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ type TestCaseV7 struct {
base
}

func (tc *TestCaseV7) Setup(t *testing.T, ctx context.Context) {
tc.base.Setup(t, ctx, "docker.elastic.co/elasticsearch/elasticsearch:7.17.24", func(addr string, _ []byte) (esClient, error) {
func (tc *TestCaseV7) Setup(ctx context.Context, t *testing.T) {
tc.base.Setup(ctx, t, "docker.elastic.co/elasticsearch/elasticsearch:7.17.24", func(addr string, _ []byte) (esClient, error) {
return elasticsearch.NewClient(elasticsearch.Config{
Addresses: []string{addr},
})
})
}

func (tc *TestCaseV7) Run(t *testing.T, ctx context.Context) {
tc.base.Run(t, ctx, func(t *testing.T, client esClient, body io.Reader) {
func (tc *TestCaseV7) Run(ctx context.Context, t *testing.T) {
tc.base.Run(ctx, t, func(t *testing.T, client esClient, body io.Reader) {
t.Helper()
req := esapi.IndexRequest{
Index: "test",
Expand Down
Loading

0 comments on commit a371785

Please sign in to comment.