2022-08-17 14:32:49 +08:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
|
|
def pytest_addoption(parser):
|
|
|
|
parser.addoption("--chaos_type", action="store", default="pod_kill", help="chaos_type")
|
2023-06-09 15:20:36 +08:00
|
|
|
parser.addoption("--role_type", action="store", default="activated", help="role_type")
|
2022-08-17 14:32:49 +08:00
|
|
|
parser.addoption("--target_component", action="store", default="querynode", help="target_component")
|
2023-05-15 09:39:22 +08:00
|
|
|
parser.addoption("--target_pod", action="store", default="etcd_leader", help="target_pod")
|
2023-09-06 14:03:14 +08:00
|
|
|
parser.addoption("--target_scope", action="store", default="all", help="target_scope")
|
2023-02-23 16:41:45 +08:00
|
|
|
parser.addoption("--target_number", action="store", default="1", help="target_number")
|
2023-09-19 16:59:22 +08:00
|
|
|
parser.addoption("--chaos_duration", action="store", default="7m", help="chaos_duration")
|
|
|
|
parser.addoption("--chaos_interval", action="store", default="2m", help="chaos_interval")
|
2023-09-01 10:31:01 +08:00
|
|
|
parser.addoption("--is_check", action="store", type=bool, default=False, help="is_check")
|
|
|
|
parser.addoption("--wait_signal", action="store", type=bool, default=True, help="wait_signal")
|
2024-05-10 11:43:30 +08:00
|
|
|
parser.addoption("--enable_import", action="store", type=bool, default=False, help="enable_import")
|
2024-01-03 15:20:49 +08:00
|
|
|
parser.addoption("--collection_num", action="store", default="1", help="collection_num")
|
2022-08-17 14:32:49 +08:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def chaos_type(request):
|
|
|
|
return request.config.getoption("--chaos_type")
|
|
|
|
|
|
|
|
|
2023-06-09 15:20:36 +08:00
|
|
|
@pytest.fixture
|
|
|
|
def role_type(request):
|
|
|
|
return request.config.getoption("--role_type")
|
|
|
|
|
|
|
|
|
2022-08-17 14:32:49 +08:00
|
|
|
@pytest.fixture
|
|
|
|
def target_component(request):
|
|
|
|
return request.config.getoption("--target_component")
|
|
|
|
|
|
|
|
|
2023-05-15 09:39:22 +08:00
|
|
|
@pytest.fixture
|
|
|
|
def target_pod(request):
|
|
|
|
return request.config.getoption("--target_pod")
|
|
|
|
|
|
|
|
|
2023-09-06 14:03:14 +08:00
|
|
|
@pytest.fixture
|
|
|
|
def target_scope(request):
|
|
|
|
return request.config.getoption("--target_scope")
|
|
|
|
|
|
|
|
|
2023-02-23 16:41:45 +08:00
|
|
|
@pytest.fixture
|
|
|
|
def target_number(request):
|
|
|
|
return request.config.getoption("--target_number")
|
|
|
|
|
|
|
|
|
2024-01-03 15:20:49 +08:00
|
|
|
@pytest.fixture
|
|
|
|
def collection_num(request):
|
|
|
|
return request.config.getoption("--collection_num")
|
|
|
|
|
|
|
|
|
2022-08-17 14:32:49 +08:00
|
|
|
@pytest.fixture
|
|
|
|
def chaos_duration(request):
|
|
|
|
return request.config.getoption("--chaos_duration")
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def chaos_interval(request):
|
|
|
|
return request.config.getoption("--chaos_interval")
|
2022-09-21 16:44:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def is_check(request):
|
2023-07-31 12:45:03 +08:00
|
|
|
return request.config.getoption("--is_check")
|
2023-09-01 10:31:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def wait_signal(request):
|
|
|
|
return request.config.getoption("--wait_signal")
|
2024-05-10 11:43:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def enable_import(request):
|
|
|
|
return request.config.getoption("--enable_import")
|