mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-27 01:50:38 +00:00
WIP
This commit is contained in:
@@ -1303,6 +1303,22 @@ def pg_bin(test_output_dir: str) -> PgBin:
|
||||
return PgBin(test_output_dir)
|
||||
|
||||
|
||||
@dataclass
|
||||
class ReplayBin:
|
||||
"""A helper class for running the pageserver benchmarker tool."""
|
||||
def run(self, tenant, timeline):
|
||||
replay_binpath = os.path.join(str(zenith_binpath), 'replay')
|
||||
args = [replay_binpath,
|
||||
"--tenant", tenant.hex,
|
||||
"--timeline", timeline.hex]
|
||||
return subprocess.run(args)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def replay_bin(test_output_dir):
|
||||
return ReplayBin()
|
||||
|
||||
|
||||
class VanillaPostgres(PgProtocol):
|
||||
def __init__(self, pgdatadir: str, pg_bin: PgBin, port: int):
|
||||
super().__init__(host='localhost', port=port, dbname='postgres')
|
||||
|
||||
16
test_runner/performance/test_pageserver.py
Normal file
16
test_runner/performance/test_pageserver.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from contextlib import closing
|
||||
|
||||
import pytest
|
||||
|
||||
from fixtures.zenith_fixtures import ZenithEnv, PgBin, ZenithEnvBuilder, DEFAULT_BRANCH_NAME, ReplayBin
|
||||
from fixtures.benchmark_fixture import MetricReport, ZenithBenchmarker
|
||||
|
||||
|
||||
def test_replay(zenith_env_builder: ZenithEnvBuilder,
|
||||
zenbenchmark: ZenithBenchmarker,
|
||||
replay_bin: ReplayBin):
|
||||
env = zenith_env_builder.init_start()
|
||||
|
||||
tenant = env.zenith_cli.create_tenant()
|
||||
timeline = env.zenith_cli.create_timeline("test_replay", tenant)
|
||||
replay_bin.run(tenant, timeline)
|
||||
Reference in New Issue
Block a user