diff --git a/receiver/sqlqueryreceiver/integration_test.go b/receiver/sqlqueryreceiver/integration_test.go index 05ed7ac2ee38..2a76081a30b0 100644 --- a/receiver/sqlqueryreceiver/integration_test.go +++ b/receiver/sqlqueryreceiver/integration_test.go @@ -1,6 +1,8 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +//go:build integration + package sqlqueryreceiver import ( @@ -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"), @@ -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) { diff --git a/receiver/sqlqueryreceiver/testdata/integration/sqlserver/configure-db.sh b/receiver/sqlqueryreceiver/testdata/integration/sqlserver/configure-db.sh index d8f058783c7c..4894c8c03bf1 100644 --- a/receiver/sqlqueryreceiver/testdata/integration/sqlserver/configure-db.sh +++ b/receiver/sqlqueryreceiver/testdata/integration/sqlserver/configure-db.sh @@ -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 \ No newline at end of file diff --git a/receiver/sqlqueryreceiver/testdata/integration/sqlserver/entrypoint.sh b/receiver/sqlqueryreceiver/testdata/integration/sqlserver/entrypoint.sh index cad7dab1451f..c375dfc19f01 100644 --- a/receiver/sqlqueryreceiver/testdata/integration/sqlserver/entrypoint.sh +++ b/receiver/sqlqueryreceiver/testdata/integration/sqlserver/entrypoint.sh @@ -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 &