Skip to content

Commit

Permalink
CI chores (#1258)
Browse files Browse the repository at this point in the history
* Avoid collisions in ClickHouse container name

* chores

* disable IPv6 in ClickHouse container

* remove 23.12
  • Loading branch information
jkaflik authored Mar 27, 2024
1 parent b3f481c commit e2e812d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 95 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
- "1.22"
- "1.21"
clickhouse: # https://github.com/ClickHouse/ClickHouse/blob/master/SECURITY.md#scope-and-supported-versions
- "latest" # 24.2
- "latest" # 24.3
- "24.2"
- "24.1"
- "23.12"
- "23.8"
- "23.3"
steps:
Expand Down
9 changes: 3 additions & 6 deletions examples/std/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ package std
import (
"context"
"fmt"
clickhouse_tests "github.com/ClickHouse/clickhouse-go/v2/tests"
"github.com/stretchr/testify/require"
"math/rand"
"os"
"strconv"
"testing"
"time"

clickhouse_tests "github.com/ClickHouse/clickhouse-go/v2/tests"
"github.com/stretchr/testify/require"
)

func TestMain(m *testing.M) {
Expand Down Expand Up @@ -132,10 +133,6 @@ func TestStdProgress(t *testing.T) {
require.NoError(t, ProgressProfileLogs())
}

func TestStdSession(t *testing.T) {
require.NoError(t, Sessions())
}

func TestStdDynamicScan(t *testing.T) {
require.NoError(t, DynamicScan())
}
Expand Down
85 changes: 0 additions & 85 deletions examples/std/session.go

This file was deleted.

2 changes: 1 addition & 1 deletion tests/resources/custom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" ?>
<clickhouse>
<listen_host>::</listen_host>
<listen_host>0.0.0.0</listen_host>
<listen_try>1</listen_try>
<https_port>8443</https_port>
<tcp_port_secure>9440</tcp_port_secure>
Expand Down
12 changes: 11 additions & 1 deletion tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
package tests

import (
"bytes"
"context"
"crypto/md5"
"crypto/tls"
"database/sql"
"encoding/binary"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -148,9 +151,16 @@ func CreateClickHouseTestEnvironment(testSet string) (ClickHouseTestEnvironment,
Soft: 262144,
},
}

buf := new(bytes.Buffer)
if err := binary.Write(buf, binary.LittleEndian, time.Now().UnixNano()); err != nil {
return ClickHouseTestEnvironment{}, err
}
containerName := fmt.Sprintf("clickhouse-go-%x", md5.Sum(buf.Bytes()))

req := testcontainers.ContainerRequest{
Image: fmt.Sprintf("clickhouse/clickhouse-server:%s", GetClickHouseTestVersion()),
Name: fmt.Sprintf("clickhouse-go-%s-%d", strings.ToLower(testSet), time.Now().UnixNano()),
Name: containerName,
ExposedPorts: []string{"9000/tcp", "8123/tcp", "9440/tcp", "8443/tcp"},
WaitingFor: wait.ForAll(
wait.ForLog("Ready for connections").WithStartupTimeout(time.Second*time.Duration(120)),
Expand Down

0 comments on commit e2e812d

Please sign in to comment.