From 1d4b00f78b2735a8fcd3a07c9089bd0562616a13 Mon Sep 17 00:00:00 2001 From: Matthias Kunnen Date: Sat, 15 Nov 2025 20:57:30 +0100 Subject: [PATCH] Replace hardcoded hostname in ping tests --- pkg/driver/clickhouse/clickhouse_test.go | 2 +- pkg/driver/mysql/mysql_test.go | 2 +- pkg/driver/postgres/postgres_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/driver/clickhouse/clickhouse_test.go b/pkg/driver/clickhouse/clickhouse_test.go index da9912e4..3697d15d 100644 --- a/pkg/driver/clickhouse/clickhouse_test.go +++ b/pkg/driver/clickhouse/clickhouse_test.go @@ -363,7 +363,7 @@ func TestClickHousePing(t *testing.T) { require.NoError(t, err) // ping invalid host should return error - drv.databaseURL.Host = "clickhouse:404" + drv.databaseURL.Host = drv.databaseURL.Hostname() + ":404" err = drv.Ping() require.Error(t, err) require.Contains(t, err.Error(), "connect: connection refused") diff --git a/pkg/driver/mysql/mysql_test.go b/pkg/driver/mysql/mysql_test.go index 048b205f..be52a0fe 100644 --- a/pkg/driver/mysql/mysql_test.go +++ b/pkg/driver/mysql/mysql_test.go @@ -393,7 +393,7 @@ func TestMySQLPing(t *testing.T) { require.NoError(t, err) // ping invalid host should return error - drv.databaseURL.Host = "mysql:404" + drv.databaseURL.Host = drv.databaseURL.Hostname() + ":404" err = drv.Ping() require.Error(t, err) require.Contains(t, err.Error(), "connect: connection refused") diff --git a/pkg/driver/postgres/postgres_test.go b/pkg/driver/postgres/postgres_test.go index d2dc4709..ef53a96c 100644 --- a/pkg/driver/postgres/postgres_test.go +++ b/pkg/driver/postgres/postgres_test.go @@ -555,7 +555,7 @@ func TestPostgresPing(t *testing.T) { require.NoError(t, err) // ping invalid host should return error - drv.databaseURL.Host = "postgres:404" + drv.databaseURL.Host = drv.databaseURL.Hostname() + ":404" err = drv.Ping() require.Error(t, err) require.Contains(t, err.Error(), "connect: connection refused")