Skip to content

Commit

Permalink
Align allow_suspicious_low_cardinality_types and `allow_suspicious_…
Browse files Browse the repository at this point in the history
…low_cardinality_types ` settings in tests due to ClickHouse Cloud incompatibility (#1331)

* Remove setting `allow_suspicious_low_cardinality_types` in tests due to ClickHouse Cloud incompatibility

* Set "allow_experimental_object_type" only when testing JSON and skip on cloud
  • Loading branch information
jkaflik authored Jun 24, 2024
1 parent 3391e46 commit 8a0701f
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 141 deletions.
6 changes: 3 additions & 3 deletions tests/issues/1049_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ package issues

import (
"context"
"testing"

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

func Test1049(t *testing.T) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
4 changes: 3 additions & 1 deletion tests/issues/1072_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package issues

import (
"context"
"testing"

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

func Test1072(t *testing.T) {
clickhouse_tests.SkipOnCloud(t, "The JSON data type is an obsolete feature on Cloud.")
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
Expand Down
3 changes: 1 addition & 2 deletions tests/issues/1106_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
func Test1106(t *testing.T) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
1 change: 1 addition & 0 deletions tests/issues/1113_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
)

func Test1113(t *testing.T) {
clickhouse_tests.SkipOnCloud(t, "The JSON data type is an obsolete feature on Cloud.")
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
Expand Down
1 change: 1 addition & 0 deletions tests/issues/1119_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
)

func Test1119(t *testing.T) {
clickhouse_tests.SkipOnCloud(t, "The JSON data type is an obsolete feature on Cloud.")
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
Expand Down
3 changes: 1 addition & 2 deletions tests/issues/1128_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ type Test struct {
func Test1128(t *testing.T) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
18 changes: 7 additions & 11 deletions tests/issues/1164_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ package issues
import (
"context"
"fmt"
"testing"

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

func TestIssue1164(t *testing.T) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down Expand Up @@ -57,8 +57,7 @@ func BenchmarkIssue1164(b *testing.B) {
b.Run("default-10000", func(b *testing.B) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down Expand Up @@ -90,8 +89,7 @@ func BenchmarkIssue1164(b *testing.B) {
b.Run("preAlloc-10000", func(b *testing.B) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down Expand Up @@ -125,8 +123,7 @@ func BenchmarkIssue1164(b *testing.B) {
b.Run("default-50000", func(b *testing.B) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down Expand Up @@ -158,8 +155,7 @@ func BenchmarkIssue1164(b *testing.B) {
b.Run("preAlloc-50000", func(b *testing.B) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
3 changes: 1 addition & 2 deletions tests/issues/1169_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
func Test1169(t *testing.T) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
3 changes: 1 addition & 2 deletions tests/issues/1200_pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
func Test1200(t *testing.T) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
3 changes: 1 addition & 2 deletions tests/issues/1216_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import (
func Test1216(t *testing.T) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
3 changes: 1 addition & 2 deletions tests/issues/1229_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ func Test1229(t *testing.T) {

var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
3 changes: 1 addition & 2 deletions tests/issues/1247_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import (
func Test1247(t *testing.T) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
8 changes: 4 additions & 4 deletions tests/issues/1271_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package issues
import (
"context"
"fmt"
"github.com/ClickHouse/clickhouse-go/v2/lib/driver"
"github.com/google/uuid"
"math/rand"
"runtime"
"strings"
"testing"
"time"

"github.com/ClickHouse/clickhouse-go/v2/lib/driver"
"github.com/google/uuid"

"github.com/ClickHouse/clickhouse-go/v2"
clickhouse_tests "github.com/ClickHouse/clickhouse-go/v2/tests"
"github.com/stretchr/testify/require"
Expand All @@ -20,8 +21,7 @@ import (
func Test1271(t *testing.T) {
var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
3 changes: 1 addition & 2 deletions tests/issues/1280_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
func Test1280(t *testing.T) {
var (
conn, err = clickhouse_tests.GetConnection(testSet, clickhouse.Settings{
"max_execution_time": 60,
"allow_experimental_object_type": true,
"max_execution_time": 60,
}, nil, &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
})
Expand Down
4 changes: 1 addition & 3 deletions tests/issues/692_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ import (
func TestIssue692(t *testing.T) {
useSSL, err := strconv.ParseBool(clickhouse_tests.GetEnv("CLICKHOUSE_USE_SSL", "false"))
require.NoError(t, err)
conn, err := clickhouse_std_tests.GetDSNConnection("issues", clickhouse.Native, useSSL, url.Values{
"allow_suspicious_low_cardinality_types": []string{"1"},
})
conn, err := clickhouse_std_tests.GetDSNConnection("issues", clickhouse.Native, useSSL, url.Values{})
require.NoError(t, err)
if !std.CheckMinServerVersion(conn, 21, 9, 0) {
t.Skip(fmt.Errorf("unsupported clickhouse version"))
Expand Down
Loading

0 comments on commit 8a0701f

Please sign in to comment.