From c7d9eda56a088af22909f52c2e126a1cdc533492 Mon Sep 17 00:00:00 2001 From: Alexey Masterov Date: Fri, 6 Sep 2024 11:25:59 +0200 Subject: [PATCH] Some refactoring --- test_runner/cloud_regress/test_cloud_regress.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/test_runner/cloud_regress/test_cloud_regress.py b/test_runner/cloud_regress/test_cloud_regress.py index 56da6afe18..d33b59f01b 100644 --- a/test_runner/cloud_regress/test_cloud_regress.py +++ b/test_runner/cloud_regress/test_cloud_regress.py @@ -3,8 +3,7 @@ Run the regression tests on the cloud instance of Neon """ import os -import re -import subprocess +from pathlib import Path import psycopg2 import pytest @@ -15,7 +14,7 @@ from fixtures.pg_version import PgVersion @pytest.mark.timeout(7200) @pytest.mark.remote_cluster -def test_cloud_regress(remote_pg: RemotePostgres, pg_version: PgVersion): +def test_cloud_regress(remote_pg: RemotePostgres, pg_version: PgVersion, pg_distrib_dir: Path): """ Run the regression tests """ @@ -35,12 +34,9 @@ def test_cloud_regress(remote_pg: RemotePostgres, pg_version: PgVersion): "RETURNS int AS 'regress.so' LANGUAGE C STRICT STABLE PARALLEL SAFE;" ) conn.rollback() - runpath = ( - f"{os.path.abspath(f'{os.path.relpath(__file__)}/../../../')}" - f"/vendor/postgres-v{pg_version}/src/test/regress" - ) - prefix = f"/tmp/neon/pg_install/v{pg_version}" - regress_bin = f"{prefix}/lib/postgresql/pgxs/src/test/regress/pg_regress" + artifact_prefix = f"/tmp/neon/pg_install/v{pg_version}" + regress_bin = f"{artifact_prefix}/lib/postgresql/pgxs/src/test/regress/pg_regress" + runpath = pg_distrib_dir / f"build/{pg_version.v_prefixed}/src/test/regress" env_vars = { "PGHOST": remote_pg.default_options["host"], @@ -56,7 +52,7 @@ def test_cloud_regress(remote_pg: RemotePostgres, pg_version: PgVersion): regress_cmd = [ regress_bin, "--inputdir=.", - f"--bindir={prefix}/bin", + f"--bindir={artifact_prefix}/bin", "--dlpath=/usr/local/lib", "--max-concurrent-tests=20", "--schedule=./parallel_schedule",