Skip to content

Commit

Permalink
Revert "fix(test suite): forward compat test is not using latest neon…
Browse files Browse the repository at this point in the history
…_local"

This reverts commit c20a379.
  • Loading branch information
skyzh committed May 9, 2024
1 parent 21f3984 commit 03038da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
14 changes: 9 additions & 5 deletions test_runner/fixtures/neon_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ def __init__(
self.env: Optional[NeonEnv] = None
self.keep_remote_storage_contents: bool = True
self.neon_binpath = neon_binpath
self.neon_local_binpath = neon_binpath
self.pg_distrib_dir = pg_distrib_dir
self.pg_version = pg_version
self.preserve_database_files = preserve_database_files
Expand Down Expand Up @@ -638,11 +637,17 @@ def _build_and_use_snapshot_impl(
def from_repo_dir(
self,
repo_dir: Path,
neon_binpath: Optional[Path] = None,
pg_distrib_dir: Optional[Path] = None,
) -> NeonEnv:
"""
A simple method to import data into the current NeonEnvBuilder from a snapshot of a repo dir.
"""

# Setting custom `neon_binpath` and `pg_distrib_dir` is useful for compatibility tests
self.neon_binpath = neon_binpath or self.neon_binpath
self.pg_distrib_dir = pg_distrib_dir or self.pg_distrib_dir

# Get the initial tenant and timeline from the snapshot config
snapshot_config_toml = repo_dir / "config"
with snapshot_config_toml.open("r") as f:
Expand Down Expand Up @@ -1017,10 +1022,9 @@ def __init__(self, config: NeonEnvBuilder):
self.pg_version = config.pg_version
# Binary path for pageserver, safekeeper, etc
self.neon_binpath = config.neon_binpath
# Binary path for neon_local test-specific binaries
self.neon_local_binpath = config.neon_local_binpath
if self.neon_local_binpath is None:
self.neon_local_binpath = self.neon_binpath
# Binary path for neon_local test-specific binaries: may be overridden
# after construction for compat testing
self.neon_local_binpath = config.neon_binpath
self.pg_distrib_dir = config.pg_distrib_dir
self.endpoint_counter = 0
self.storage_controller_config = config.storage_controller_config
Expand Down
15 changes: 7 additions & 8 deletions test_runner/regress/test_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,17 @@ def test_forward_compatibility(
neon_env_builder.pageserver_validate_vectored_get = None

neon_env_builder.num_safekeepers = 3

# Use previous version's production binaries (pageserver, safekeeper, pg_distrib_dir, etc.).
# But always use the current version's neon_local binary.
# This is because we want to test the compatibility of the data format, not the compatibility of the neon_local CLI.
neon_env_builder.neon_binpath = compatibility_neon_bin
neon_env_builder.pg_distrib_dir = compatibility_postgres_distrib_dir
neon_env_builder.neon_local_binpath = neon_env_builder.neon_local_binpath

neon_local_binpath = neon_env_builder.neon_binpath
env = neon_env_builder.from_repo_dir(
compatibility_snapshot_dir / "repo",
neon_binpath=compatibility_neon_bin,
pg_distrib_dir=compatibility_postgres_distrib_dir,
)

# Use current neon_local even though we're using old binaries for
# everything else: our test code is written for latest CLI args.
env.neon_local_binpath = neon_local_binpath

neon_env_builder.start()

check_neon_works(
Expand Down

0 comments on commit 03038da

Please sign in to comment.