Skip to content

Commit

Permalink
fix: more inconsistent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerTorres committed Feb 27, 2025
1 parent d21fac7 commit b18ec81
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
go:
- "1.23"
- "1.24"
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
10 changes: 3 additions & 7 deletions tests/std/temporary_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ package std
import (
"context"
"fmt"
clickhouse_tests "github.com/ClickHouse/clickhouse-go/v2/tests"
"github.com/stretchr/testify/require"
"strconv"
"testing"

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

"github.com/ClickHouse/clickhouse-go/v2"
"github.com/stretchr/testify/assert"
)
Expand All @@ -36,11 +37,6 @@ func TestStdTemporaryTable(t *testing.T) {
for name, protocol := range dsns {
t.Run(fmt.Sprintf("%s Protocol", name), func(t *testing.T) {
ctx := context.Background()
if name == "Http" {
ctx = clickhouse.Context(ctx, clickhouse.WithSettings(clickhouse.Settings{
"session_id": "test_session",
}))
}
conn, err := GetStdDSNConnection(protocol, useSSL, nil)
require.NoError(t, err)
conn.Exec("DROP TABLE IF EXISTS test_temporary_table")
Expand Down
13 changes: 7 additions & 6 deletions tests/std/uuid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ package std

import (
"fmt"
clickhouse_tests "github.com/ClickHouse/clickhouse-go/v2/tests"
"github.com/stretchr/testify/require"
"strconv"
"testing"

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

"github.com/google/uuid"
"github.com/stretchr/testify/assert"
)
Expand All @@ -34,10 +35,10 @@ func TestStdUUID(t *testing.T) {
useSSL, err := strconv.ParseBool(clickhouse_tests.GetEnv("CLICKHOUSE_USE_SSL", "false"))
require.NoError(t, err)
dsns := map[string]string{"Native": fmt.Sprintf("clickhouse://%s:%d?username=%s&password=%s", env.Host, env.Port, env.Username, env.Password),
"Http": fmt.Sprintf("http://%s:%d?username=%s&password=%s&session_id=session", env.Host, env.HttpPort, env.Username, env.Password)}
"Http": fmt.Sprintf("http://%s:%d?username=%s&password=%s", env.Host, env.HttpPort, env.Username, env.Password)}
if useSSL {
dsns = map[string]string{"Native": fmt.Sprintf("clickhouse://%s:%d?username=%s&password=%s&secure=true", env.Host, env.SslPort, env.Username, env.Password),
"Http": fmt.Sprintf("https://%s:%d?username=%s&password=%s&session_id=session&secure=true", env.Host, env.HttpsPort, env.Username, env.Password)}
"Http": fmt.Sprintf("https://%s:%d?username=%s&password=%s&secure=true", env.Host, env.HttpsPort, env.Username, env.Password)}
}

for name, dsn := range dsns {
Expand Down Expand Up @@ -83,10 +84,10 @@ func TestStdNullableUUID(t *testing.T) {
useSSL, err := strconv.ParseBool(clickhouse_tests.GetEnv("CLICKHOUSE_USE_SSL", "false"))
require.NoError(t, err)
dsns := map[string]string{"Native": fmt.Sprintf("clickhouse://%s:%d?username=%s&password=%s", env.Host, env.Port, env.Username, env.Password),
"Http": fmt.Sprintf("http://%s:%d?username=%s&password=%s&session_id=session", env.Host, env.HttpPort, env.Username, env.Password)}
"Http": fmt.Sprintf("http://%s:%d?username=%s&password=%s", env.Host, env.HttpPort, env.Username, env.Password)}
if useSSL {
dsns = map[string]string{"Native": fmt.Sprintf("clickhouse://%s:%d?username=%s&password=%s&secure=true", env.Host, env.SslPort, env.Username, env.Password),
"Http": fmt.Sprintf("https://%s:%d?username=%s&password=%s&session_id=session&secure=true", env.Host, env.HttpsPort, env.Username, env.Password)}
"Http": fmt.Sprintf("https://%s:%d?username=%s&password=%s&secure=true", env.Host, env.HttpsPort, env.Username, env.Password)}
}
for name, dsn := range dsns {
t.Run(fmt.Sprintf("%s Protocol", name), func(t *testing.T) {
Expand Down

0 comments on commit b18ec81

Please sign in to comment.