ClickHouse/tests/integration/test_s3_storage_class/test.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.1 KiB
Python
Raw Normal View History

2023-01-04 16:23:22 +00:00
import logging
2024-09-27 10:19:39 +00:00
import os
2023-01-04 16:23:22 +00:00
import pytest
2024-09-27 10:19:39 +00:00
2023-01-04 16:23:22 +00:00
from helpers.cluster import ClickHouseCluster
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
cluster = ClickHouseCluster(__file__)
2023-01-05 00:59:05 +00:00
node = cluster.add_instance(
"node",
main_configs=["configs/config.d/minio.xml"],
stay_alive=True,
with_minio=True,
)
2023-01-04 16:23:22 +00:00
2023-01-05 01:09:42 +00:00
2023-01-04 16:23:22 +00:00
@pytest.fixture(scope="module")
def started_cluster():
try:
cluster.start()
yield cluster
finally:
cluster.shutdown()
def test_s3_storage_class_right(started_cluster):
node.query(
"""
CREATE TABLE test_s3_storage_class
(
`id` UInt64,
`value` String
)
ENGINE = MergeTree
ORDER BY id
SETTINGS storage_policy='use_s3_storage_class';
""",
)
node.query(
"""
INSERT INTO test_s3_storage_class VALUES (1, 'a');
""",
)
result = node.query(
"""
SELECT id FROM test_s3_storage_class;
"""
)
assert result == "1\n"