Skip to content

Commit

Permalink
use non-default user in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerTorres committed Feb 3, 2025
1 parent 9ae8c68 commit db622c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
15 changes: 9 additions & 6 deletions tests/resources/admin.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<clickhouse>
<!-- Profiles of settings. -->
<profiles>
<!-- Default settings. -->
<default>
<tester>
<max_threads>1</max_threads>
<max_block_size>8000</max_block_size>
</default>
</tester>
</profiles>
<users>
<default>
<tester>
<profile>tester</profile>
<password>ClickHouse</password>
<networks>
<ip>::/0</ip>
</networks>
<quota>default</quota>
<access_management>1</access_management>
</default>
</tester>
</users>
</clickhouse>
5 changes: 2 additions & 3 deletions tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func CreateClickHouseTestEnvironment(testSet string) (ClickHouseTestEnvironment,
ExposedPorts: []string{"9000/tcp", "8123/tcp", "9440/tcp", "8443/tcp"},
WaitingFor: wait.ForAll(
wait.ForSQL("9000/tcp", "clickhouse", func(host string, port nat.Port) string {
return fmt.Sprintf("clickhouse://default:ClickHouse@%s:%s?secure=false", host, port.Port())
return fmt.Sprintf("clickhouse://tester:ClickHouse@%s:%s?secure=false", host, port.Port())
}),
).WithDeadline(time.Second * 120),
Mounts: []testcontainers.ContainerMount{
Expand Down Expand Up @@ -210,8 +210,7 @@ func CreateClickHouseTestEnvironment(testSet string) (ClickHouseTestEnvironment,
SslPort: sslPort.Int(),
HttpsPort: hps.Int(),
Host: "127.0.0.1",
// we set this explicitly - note its also set in the /etc/clickhouse-server/users.d/admin.xml
Username: "default",
Username: "tester",
Password: "ClickHouse",
Container: clickhouseContainer,
ContainerIP: ip,
Expand Down

0 comments on commit db622c7

Please sign in to comment.