Skip to content

Commit

Permalink
Fixed lint errors, restored skipping integration tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Grandys committed Dec 23, 2024
1 parent 1bdd23c commit 3044d01
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 4 additions & 3 deletions receiver/sqlqueryreceiver/integration_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:build integration

package sqlqueryreceiver

import (
Expand Down Expand Up @@ -123,7 +125,7 @@ var (
},
Driver: "oracle",
CurrentTimestampFunction: "SYSTIMESTAMP",
ConvertColumnName: func(name string) string { return strings.ToUpper(name) },
ConvertColumnName: strings.ToUpper,
ContainerRequest: testcontainers.ContainerRequest{
FromDockerfile: testcontainers.FromDockerfile{
Context: filepath.Join("testdata", "integration", "oracle"),
Expand Down Expand Up @@ -399,11 +401,10 @@ func insertSimpleLogs(t *testing.T, engine DbEngine, container testcontainers.Co
defer db.Close()

for newLogID := existingLogID + 1; newLogID <= existingLogID+newLogCount; newLogID++ {
query := fmt.Sprintf("insert into simple_logs (id, insert_time, body, attribute) values (%d, %s, 'another log %d', 'TLSv1.2')", newLogID, engine.CurrentTimestampFunction, newLogID)
query := fmt.Sprintf("insert into simple_logs (id, insert_time, body, attribute) values (%d, %s, 'another log %d', 'TLSv1.2')", newLogID, engine.CurrentTimestampFunction, newLogID) // nolint:gosec // Ignore, not possible to use prepared statements here for currentTimestampFunction
_, err := db.Exec(query)
require.NoError(t, err)
}

}

func createTestLogsReceiver(t *testing.T, driver, dataSource string, receiverCreateSettings receiver.Settings) (*logsReceiver, *Config, *consumertest.LogsSink) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
#
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
#
#


# Run the SQL script to initialize the database
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P YourStrong!Passw0rd -d master -i /usr/src/app/init.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
#
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
#
#


# Start SQL Server in the background
/opt/mssql/bin/sqlservr &
Expand Down

0 comments on commit 3044d01

Please sign in to comment.