This commit is contained in:
Bojan Serafimov
2022-05-04 14:16:43 -04:00
parent faa15e32ee
commit d67fb28a59
3 changed files with 88 additions and 1 deletions

View File

@@ -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')

View 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)