Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions internal/migrator/migrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ func TestMigrator_CredentialExposure_Integration(t *testing.T) {
},
},
{
name: "ClickHouse - connection timeout scenario",
name: "ClickHouse - connection failure scenario",
opts: MigrationOpts{
CH: MigrationOptsCH{
// Using non-routable IP to simulate timeout
// 192.0.2.0/24 is reserved for documentation (RFC 5737)
Addr: "192.0.2.1:9000",
// Using localhost:1 - port 1 is reserved and will be refused immediately
// This tests credential sanitization without waiting for network timeout
Addr: "localhost:1",
Username: "admin",
Password: "VerySecretPass456$",
Database: "analytics_db",
},
},
shouldFailValidation: false,
checkError: func(t *testing.T, err error) {
// We expect an error due to timeout/unreachable host
require.Error(t, err, "Should fail to connect to unreachable host")
// We expect an error due to connection refused
require.Error(t, err, "Should fail to connect to closed port")

// The error should NOT contain the actual password
assert.NotContains(t, err.Error(), "VerySecretPass456$",
Expand Down