ClickHouse@1
ClickHouse@1 Provider lets you test data in ClickHouse server.
If you want to test your data in your ClickHouse server, you’ll need ClickHouse@1 provider in CAT.
This provider is in Preview! Any feedback is highly appreciated.
You can use the “Get Help” button on the right side of this site. It might speed up the preview phase. Thank you! 😻
Example
Data Sources:
- Name: MyClickHouseData
Provider: ClickHouse@1
Connection string: "Host=localhost;Protocol=https;Port=8443;Username=default;Password=;"
As with any other provider - never specify secrets directly to your configuration files. Use Environment variables instead, such as
Connection string: "Host=localhost;Protocol=https;Port=8443;Username=default;Password=%MY_PASSWORD_FOR_CLICKHOUSE%;"
or you can hide the entire connection string:
Connection string: "%MY_CLICKHOUSE_CONNECTION_STRING%"
Prerequisites
This provider has no prerequisites and comes out-of-the-box with CAT. You don’t have to install anything.
Storing Test definitions and Data Source definitions in DB
ClickHouse is an analytical system, so it is not expected you want to store test definitions (or even data source definitions) in such a database.
However, technically it is of course possible and there is nothing wrong with it. E.g., if you use CAT solely for testing data in ClickHouse databases, it might make sense.
CREATE TABLE test.cat_test_definition
(
test_suite String,
`order` Int32,
test_case String,
test_name String NOT NULL,
description String,
first_data_source String,
first_query String,
second_data_source String,
second_query String,
expectation String NOT NULL,
categories String,
tolerance Decimal32(4),
timeout Int32,
`key` String,
maximum_errors_logged Int32
)
ENGINE = MergeTree()
ORDER BY (test_suite, `order`, test_case, test_name)
In a similar manner you can store data source definition in this database, but have prepared a good reason for doing so :).
CREATE TABLE test.cat_connection_definition
(
name String NOT NULL,
provider String NOT NULL,
connection_string String NOT NULL,
CONSTRAINT unique_name UNIQUE KEY (name)
)
ENGINE = MergeTree()
ORDER BY (name, provider)
Details
Under the hood, CAT uses this .NET package for connecting to your data: https://clickhouse.com/integrations/csharp