2024-06-11 13:36:20 +02:00
|
|
|
import os
|
2024-10-11 11:08:39 +03:00
|
|
|
import threading
|
2024-06-11 13:36:20 +02:00
|
|
|
from dataclasses import dataclass
|
|
|
|
|
2024-10-11 11:08:39 +03:00
|
|
|
import pytest as pytest
|
|
|
|
|
2024-06-11 13:36:20 +02:00
|
|
|
|
|
|
|
def pytest_addoption(parser):
|
|
|
|
parser.addoption(
|
2024-10-07 17:40:18 +02:00
|
|
|
"--rpc_url_statusd",
|
2024-06-11 13:36:20 +02:00
|
|
|
action="store",
|
|
|
|
help="",
|
|
|
|
default="http://0.0.0.0:3333",
|
|
|
|
)
|
2024-09-16 10:23:57 +02:00
|
|
|
parser.addoption(
|
2024-10-07 17:40:18 +02:00
|
|
|
"--ws_url_statusd",
|
2024-09-16 10:23:57 +02:00
|
|
|
action="store",
|
|
|
|
help="",
|
|
|
|
default="ws://0.0.0.0:8354",
|
|
|
|
)
|
2024-10-07 17:40:18 +02:00
|
|
|
parser.addoption(
|
2024-11-21 15:21:53 +01:00
|
|
|
"--status_backend_urls",
|
2024-10-07 17:40:18 +02:00
|
|
|
action="store",
|
|
|
|
help="",
|
2024-11-21 15:21:53 +01:00
|
|
|
default=[
|
|
|
|
f"http://0.0.0.0:{3314 + i}" for i in range(
|
|
|
|
int(os.getenv("STATUS_BACKEND_COUNT", 10))
|
|
|
|
)
|
|
|
|
],
|
2024-10-07 17:40:18 +02:00
|
|
|
)
|
2024-09-25 14:27:04 +02:00
|
|
|
parser.addoption(
|
|
|
|
"--anvil_url",
|
|
|
|
action="store",
|
|
|
|
help="",
|
|
|
|
default="http://0.0.0.0:8545",
|
|
|
|
)
|
2024-06-11 13:36:20 +02:00
|
|
|
parser.addoption(
|
|
|
|
"--password",
|
|
|
|
action="store",
|
|
|
|
help="",
|
|
|
|
default="Strong12345",
|
|
|
|
)
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class Option:
|
|
|
|
pass
|
|
|
|
|
2024-10-11 11:08:39 +03:00
|
|
|
|
2024-06-11 13:36:20 +02:00
|
|
|
option = Option()
|
|
|
|
|
2024-10-11 11:08:39 +03:00
|
|
|
|
2024-06-11 13:36:20 +02:00
|
|
|
def pytest_configure(config):
|
|
|
|
global option
|
|
|
|
option = config.option
|
2024-11-21 15:21:53 +01:00
|
|
|
if type(option.status_backend_urls) is str:
|
|
|
|
option.status_backend_urls = option.status_backend_urls.split(",")
|
2024-06-11 13:36:20 +02:00
|
|
|
option.base_dir = os.path.dirname(os.path.abspath(__file__))
|