Skip to content

Commit

Permalink
chore(outputs.sql): Update ClickHouse Docker image for integration te…
Browse files Browse the repository at this point in the history
…st (#16462)
  • Loading branch information
AndreKR authored Feb 6, 2025
1 parent e839ad1 commit cf56e4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plugins/outputs/sql/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ func TestClickHouseIntegration(t *testing.T) {
t.Skip("Skipping integration test in short mode")
}

logConfig, err := filepath.Abs("testdata/clickhouse/enable_stdout_log.xml")
require.NoError(t, err)

initdb, err := filepath.Abs("testdata/clickhouse/initdb/init.sql")
require.NoError(t, err)

Expand All @@ -344,16 +347,17 @@ func TestClickHouseIntegration(t *testing.T) {

servicePort := "9000"
container := testutil.Container{
Image: "yandex/clickhouse-server",
Image: "clickhouse",
ExposedPorts: []string{servicePort, "8123"},
Files: map[string]string{
"/docker-entrypoint-initdb.d/script.sql": initdb,
"/out": outDir,
"/docker-entrypoint-initdb.d/script.sql": initdb,
"/etc/clickhouse-server/config.d/enable_stdout_log.xml": logConfig,
"/out": outDir,
},
WaitingFor: wait.ForAll(
wait.NewHTTPStrategy("/").WithPort(nat.Port("8123")),
wait.ForListeningPort(nat.Port(servicePort)),
wait.ForLog("Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/users.xml'").WithOccurrence(2),
wait.ForLog("Ready for connections"),
),
}
err = container.Start()
Expand Down
5 changes: 5 additions & 0 deletions plugins/outputs/sql/testdata/clickhouse/enable_stdout_log.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<clickhouse>
<logger>
<console>1</console>
</logger>
</clickhouse>

0 comments on commit cf56e4a

Please sign in to comment.