diff --git a/Makefile b/Makefile index 60a3cc0..cbcc67a 100644 --- a/Makefile +++ b/Makefile @@ -56,8 +56,8 @@ gen-proto: install-proto .PHONY: unset-dependencies unset-dependencies: - docker compose stop postgres redis minio clickhouse - docker compose rm -f postgres redis minio clickhouse + docker compose stop postgres redis minio + docker compose rm -f postgres redis minio .PHONY: unset-data unset-data: build @@ -65,11 +65,11 @@ unset-data: build .PHONY: setup-dependencies setup-dependencies: build get-front get-problem-packages - @if [ "$(shell docker ps -f status=running | grep -E "postgres|redis|minio|clickhouse" | wc -l)" -eq 4 ]; then \ + @if [ "$(shell docker ps -f status=running | grep -E "postgres|redis|minio" | wc -l)" -eq 4 ]; then \ echo "Containers already up"; \ ./bin/clean; \ else \ - docker compose up -d postgres redis minio clickhouse; \ + docker compose up -d postgres redis minio; \ @echo "Wait 10 seconds for db setup"; \ sleep 10s; \ fi diff --git a/modules/agent/clickhouse/clickhouse_test.go b/modules/agent/clickhouse/clickhouse_test.go index 225d01e..f0c188c 100644 --- a/modules/agent/clickhouse/clickhouse_test.go +++ b/modules/agent/clickhouse/clickhouse_test.go @@ -1,68 +1,68 @@ package clickhouse_agent -import ( - "context" - "testing" - "time" +// import ( +// "context" +// "testing" +// "time" - "github.com/google/uuid" -) +// "github.com/google/uuid" +// ) -func TestClickhouse(t *testing.T) { - var ctx = context.Background() - t.Log("TestClickhouse") - conn, err := Connect() - if err != nil { - t.Error(err) - } - t.Log(conn) - err = conn.Exec(context.Background(), "DROP TABLE IF EXISTS example") - if err != nil { - t.Error(err) - } - err = conn.Exec(ctx, ` - CREATE TABLE IF NOT EXISTS example ( - Col1 UInt8, - Col2 String, - Col3 FixedString(3), - Col4 UUID, - Col5 Map(String, UInt8), - Col6 Array(String), - Col7 Tuple(String, UInt8, Array(Map(String, String))), - Col8 DateTime - ) Engine = Memory -`) - if err != nil { - t.Error(err) - } +// func TestClickhouse(t *testing.T) { +// var ctx = context.Background() +// t.Log("TestClickhouse") +// conn, err := Connect() +// if err != nil { +// t.Error(err) +// } +// t.Log(conn) +// err = conn.Exec(context.Background(), "DROP TABLE IF EXISTS example") +// if err != nil { +// t.Error(err) +// } +// err = conn.Exec(ctx, ` +// CREATE TABLE IF NOT EXISTS example ( +// Col1 UInt8, +// Col2 String, +// Col3 FixedString(3), +// Col4 UUID, +// Col5 Map(String, UInt8), +// Col6 Array(String), +// Col7 Tuple(String, UInt8, Array(Map(String, String))), +// Col8 DateTime +// ) Engine = Memory +// `) +// if err != nil { +// t.Error(err) +// } - batch, err := conn.PrepareBatch(ctx, "INSERT INTO example") - if err != nil { - t.Error(err) - } - for i := 0; i < 1000; i++ { - err := batch.Append( - uint8(42), - "ClickHouse", - "Inc", - uuid.New(), - map[string]uint8{"key": 1}, // Map(String, UInt8) - []string{"Q", "W", "E", "R", "T", "Y"}, // Array(String) - []interface{}{ // Tuple(String, UInt8, Array(Map(String, String))) - "String Value", uint8(5), []map[string]string{ - {"key": "value"}, - {"key": "value"}, - {"key": "value"}, - }, - }, - time.Now(), - ) - if err != nil { - t.Error(err) - } - } - err = batch.Send() - if err != nil { - t.Error(err) - } -} +// batch, err := conn.PrepareBatch(ctx, "INSERT INTO example") +// if err != nil { +// t.Error(err) +// } +// for i := 0; i < 1000; i++ { +// err := batch.Append( +// uint8(42), +// "ClickHouse", +// "Inc", +// uuid.New(), +// map[string]uint8{"key": 1}, // Map(String, UInt8) +// []string{"Q", "W", "E", "R", "T", "Y"}, // Array(String) +// []interface{}{ // Tuple(String, UInt8, Array(Map(String, String))) +// "String Value", uint8(5), []map[string]string{ +// {"key": "value"}, +// {"key": "value"}, +// {"key": "value"}, +// }, +// }, +// time.Now(), +// ) +// if err != nil { +// t.Error(err) +// } +// } +// err = batch.Send() +// if err != nil { +// t.Error(err) +// } +// }