From a7f8b9f6b5eee8f1271639206996882d87c4c021 Mon Sep 17 00:00:00 2001 From: Gleb Novikov Date: Fri, 3 Jan 2025 15:13:19 +0000 Subject: [PATCH] poetry run ruff format . --- test_runner/fixtures/fast_import.py | 35 ++++++++++++----------- test_runner/regress/test_import_pgdata.py | 9 +++--- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/test_runner/fixtures/fast_import.py b/test_runner/fixtures/fast_import.py index 632b09fea0..4784e493a3 100644 --- a/test_runner/fixtures/fast_import.py +++ b/test_runner/fixtures/fast_import.py @@ -16,12 +16,12 @@ class FastImport(AbstractNeonCli): cmd: subprocess.CompletedProcess[str] | None = None def __init__( - self, - extra_env: dict[str, str] | None, - binpath: Path, - pg_distrib_dir: Path, - pg_version: PgVersion, - workdir: Path + self, + extra_env: dict[str, str] | None, + binpath: Path, + pg_distrib_dir: Path, + pg_version: PgVersion, + workdir: Path, ): if extra_env is None: env_vars = {} @@ -44,12 +44,13 @@ class FastImport(AbstractNeonCli): raise Exception(f"Working directory '{workdir}' does not exist") self.workdir = workdir - def run(self, - pg_port: int, - source_connection_string: str | None = None, - s3prefix: str | None = None, - interactive: bool = False, - ) -> subprocess.CompletedProcess[str]: + def run( + self, + pg_port: int, + source_connection_string: str | None = None, + s3prefix: str | None = None, + interactive: bool = False, + ) -> subprocess.CompletedProcess[str]: if self.cmd is not None: raise Exception("Command already executed") args = [ @@ -78,10 +79,10 @@ class FastImport(AbstractNeonCli): @pytest.fixture(scope="function") def fast_import( - pg_version: PgVersion, - test_output_dir: Path, - neon_binpath: Path, - pg_distrib_dir: Path, + pg_version: PgVersion, + test_output_dir: Path, + neon_binpath: Path, + pg_distrib_dir: Path, ) -> Iterator[FastImport]: workdir = Path(tempfile.mkdtemp()) with FastImport(None, neon_binpath, pg_distrib_dir, pg_version, workdir) as fi: @@ -96,4 +97,4 @@ def fast_import( with open(test_output_dir / "fast_import.stderr", "w") as f: f.write(fi.cmd.stderr) - log.info('Written logs to %s', test_output_dir) + log.info("Written logs to %s", test_output_dir) diff --git a/test_runner/regress/test_import_pgdata.py b/test_runner/regress/test_import_pgdata.py index 05d12c756b..95e734c72e 100644 --- a/test_runner/regress/test_import_pgdata.py +++ b/test_runner/regress/test_import_pgdata.py @@ -322,10 +322,10 @@ def test_pgdata_import_smoke( "newer control file catalog version and struct format isn't supported", ) def test_fast_import_binary( - test_output_dir, - vanilla_pg: VanillaPostgres, - port_distributor: PortDistributor, - fast_import: FastImport, + test_output_dir, + vanilla_pg: VanillaPostgres, + port_distributor: PortDistributor, + fast_import: FastImport, ): vanilla_pg.start() vanilla_pg.safe_psql("CREATE TABLE foo (a int); INSERT INTO foo SELECT generate_series(1, 10);") @@ -345,6 +345,7 @@ def test_fast_import_binary( assert res[0][0] == 10 new_pgdata_vanilla_pg.stop() + # TODO: Maybe test with pageserver? # 1. run whole neon env # 2. create timeline with some s3 path???