Skip to content

Commit e2e812d

Browse files
authored
CI chores (#1258)
* Avoid collisions in ClickHouse container name * chores * disable IPv6 in ClickHouse container * remove 23.12
1 parent b3f481c commit e2e812d

File tree

5 files changed

+17
-95
lines changed

5 files changed

+17
-95
lines changed

.github/workflows/run-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
- "1.22"
2121
- "1.21"
2222
clickhouse: # https://github.com/ClickHouse/ClickHouse/blob/master/SECURITY.md#scope-and-supported-versions
23-
- "latest" # 24.2
23+
- "latest" # 24.3
24+
- "24.2"
2425
- "24.1"
25-
- "23.12"
2626
- "23.8"
2727
- "23.3"
2828
steps:

examples/std/main_test.go

+3-6
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ package std
2020
import (
2121
"context"
2222
"fmt"
23-
clickhouse_tests "github.com/ClickHouse/clickhouse-go/v2/tests"
24-
"github.com/stretchr/testify/require"
2523
"math/rand"
2624
"os"
2725
"strconv"
2826
"testing"
2927
"time"
28+
29+
clickhouse_tests "github.com/ClickHouse/clickhouse-go/v2/tests"
30+
"github.com/stretchr/testify/require"
3031
)
3132

3233
func TestMain(m *testing.M) {
@@ -132,10 +133,6 @@ func TestStdProgress(t *testing.T) {
132133
require.NoError(t, ProgressProfileLogs())
133134
}
134135

135-
func TestStdSession(t *testing.T) {
136-
require.NoError(t, Sessions())
137-
}
138-
139136
func TestStdDynamicScan(t *testing.T) {
140137
require.NoError(t, DynamicScan())
141138
}

examples/std/session.go

-85
This file was deleted.

tests/resources/custom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" ?>
22
<clickhouse>
3-
<listen_host>::</listen_host>
3+
<listen_host>0.0.0.0</listen_host>
44
<listen_try>1</listen_try>
55
<https_port>8443</https_port>
66
<tcp_port_secure>9440</tcp_port_secure>

tests/utils.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
package tests
1919

2020
import (
21+
"bytes"
2122
"context"
23+
"crypto/md5"
2224
"crypto/tls"
2325
"database/sql"
26+
"encoding/binary"
2427
"encoding/json"
2528
"errors"
2629
"fmt"
@@ -148,9 +151,16 @@ func CreateClickHouseTestEnvironment(testSet string) (ClickHouseTestEnvironment,
148151
Soft: 262144,
149152
},
150153
}
154+
155+
buf := new(bytes.Buffer)
156+
if err := binary.Write(buf, binary.LittleEndian, time.Now().UnixNano()); err != nil {
157+
return ClickHouseTestEnvironment{}, err
158+
}
159+
containerName := fmt.Sprintf("clickhouse-go-%x", md5.Sum(buf.Bytes()))
160+
151161
req := testcontainers.ContainerRequest{
152162
Image: fmt.Sprintf("clickhouse/clickhouse-server:%s", GetClickHouseTestVersion()),
153-
Name: fmt.Sprintf("clickhouse-go-%s-%d", strings.ToLower(testSet), time.Now().UnixNano()),
163+
Name: containerName,
154164
ExposedPorts: []string{"9000/tcp", "8123/tcp", "9440/tcp", "8443/tcp"},
155165
WaitingFor: wait.ForAll(
156166
wait.ForLog("Ready for connections").WithStartupTimeout(time.Second*time.Duration(120)),

0 commit comments

Comments
 (0)