2020-07-02 15:58:13 +00:00
|
|
|
#!/usr/bin/env python3
|
2021-05-07 13:14:40 +00:00
|
|
|
import os
|
2020-07-02 15:58:13 +00:00
|
|
|
import sys
|
|
|
|
from testflows.core import *
|
|
|
|
|
2020-10-15 20:23:49 +00:00
|
|
|
append_path(sys.path, "..")
|
2020-07-02 15:58:13 +00:00
|
|
|
|
|
|
|
from helpers.cluster import Cluster
|
|
|
|
from helpers.argparser import argparser
|
|
|
|
|
|
|
|
@TestFeature
|
|
|
|
@Name("example")
|
|
|
|
@ArgumentParser(argparser)
|
2021-07-31 19:50:27 +00:00
|
|
|
def regression(self, local, clickhouse_binary_path, stress=None):
|
2020-07-02 15:58:13 +00:00
|
|
|
"""Simple example of how you can use TestFlows to test ClickHouse.
|
|
|
|
"""
|
|
|
|
nodes = {
|
|
|
|
"clickhouse": ("clickhouse1",),
|
|
|
|
}
|
2020-10-15 20:23:49 +00:00
|
|
|
|
2021-05-10 20:59:47 +00:00
|
|
|
if stress is not None:
|
|
|
|
self.context.stress = stress
|
|
|
|
|
2021-05-07 13:14:40 +00:00
|
|
|
with Cluster(local, clickhouse_binary_path, nodes=nodes,
|
|
|
|
docker_compose_project_dir=os.path.join(current_dir(), "example_env")) as cluster:
|
2020-07-02 15:58:13 +00:00
|
|
|
self.context.cluster = cluster
|
|
|
|
|
|
|
|
Scenario(run=load("example.tests.example", "scenario"))
|
|
|
|
|
|
|
|
if main():
|
|
|
|
regression()
|