Skip to content

Commit

Permalink
chore(test): add version check for forward compat test (#7685)
Browse files Browse the repository at this point in the history
A test for #7684.

This pull request checks if the pageserver version we specified is the
one actually running by comparing the git hash in forward compatibility
tests.

---------

Signed-off-by: Alex Chi Z <chi@neon.tech>
  • Loading branch information
skyzh authored May 14, 2024
1 parent b6ee918 commit 30d15ad
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test_runner/regress/test_compatibility.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
import shutil
import subprocess
import tempfile
Expand Down Expand Up @@ -245,14 +246,34 @@ def test_forward_compatibility(
compatibility_snapshot_dir / "repo",
)

# not using env.pageserver.version because it was initialized before
prev_pageserver_version_str = env.get_binary_version("pageserver")
prev_pageserver_version_match = re.search(
"Neon page server git-env:(.*) failpoints: (.*), features: (.*)",
prev_pageserver_version_str,
)
if prev_pageserver_version_match is not None:
prev_pageserver_version = prev_pageserver_version_match.group(1)
else:
raise AssertionError(
"cannot find git hash in the version string: " + prev_pageserver_version_str
)

# does not include logs from previous runs
assert not env.pageserver.log_contains("git-env:" + prev_pageserver_version)

neon_env_builder.start()

# ensure the specified pageserver is running
assert env.pageserver.log_contains("git-env:" + prev_pageserver_version)

check_neon_works(
env,
test_output_dir=test_output_dir,
sql_dump_path=compatibility_snapshot_dir / "dump.sql",
repo_dir=env.repo_dir,
)

except Exception:
if breaking_changes_allowed:
pytest.xfail(
Expand Down

1 comment on commit 30d15ad

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3141 tests run: 3001 passed, 0 failed, 140 skipped (full report)


Flaky tests (2)

Postgres 16

  • test_crafted_wal_end[wal_record_crossing_segment_followed_by_small_one]: debug

Postgres 15

  • test_vm_bit_clear_on_heap_lock: debug

Code coverage* (full report)

  • functions: 31.4% (6338 of 20189 functions)
  • lines: 47.3% (47941 of 101250 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
30d15ad at 2024-05-14T16:01:10.244Z :recycle:

Please sign in to comment.