-
Notifications
You must be signed in to change notification settings - Fork 373
Expand file tree
/
Copy pathtest_starrocks.py
More file actions
29 lines (21 loc) · 932 Bytes
/
test_starrocks.py
File metadata and controls
29 lines (21 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from pathlib import Path
import requests
import pytest
import sqlalchemy
from testcontainers.starrocks import StarRocksContainer
def test_docker_run_starrocks():
starrocks_container = StarRocksContainer()
with starrocks_container as starrocks:
host = starrocks.get_container_host_ip()
port = starrocks.get_exposed_port(8030)
response = requests.get(f'http://{host}:{port}/api/health')
assert response.status_code == 200
@pytest.mark.inside_docker_check
def test_docker_run_starrocks_with_sqlalchemy():
starrocks_container = StarRocksContainer()
with starrocks_container as starrocks:
engine = sqlalchemy.create_engine(starrocks.get_connection_url())
with engine.begin() as connection:
result = connection.execute(sqlalchemy.text("select version()"))
for row in result:
assert row[0].lower().startswith("8.0.33")