mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-10 15:02:56 +00:00
Push the migrations test
This commit is contained in:
committed by
Sasha Krassovsky
parent
a718287902
commit
394ef013d0
27
test_runner/regress/test_migrations.py
Normal file
27
test_runner/regress/test_migrations.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from fixtures.neon_fixtures import NeonEnv
|
||||
|
||||
|
||||
def test_migrations(neon_simple_env: NeonEnv):
|
||||
env = neon_simple_env
|
||||
env.neon_cli.create_branch("test_migrations", "empty")
|
||||
endpoint = env.endpoints.create("test_migrations")
|
||||
endpoint.respec(skip_pg_catalog_updates=False)
|
||||
endpoint.start()
|
||||
|
||||
with endpoint.cursor() as cur:
|
||||
cur.execute("SELECT last_value FROM neon_migration.migration_id")
|
||||
migration_id = cur.fetchall()
|
||||
assert migration_id[0][0] == 2
|
||||
|
||||
endpoint.stop()
|
||||
endpoint.start()
|
||||
with endpoint.cursor() as cur:
|
||||
cur.execute("SELECT last_value FROM neon_migration.migration_id")
|
||||
migration_id = cur.fetchall()
|
||||
assert migration_id[0][0] == 2
|
||||
|
||||
log_path = endpoint.endpoint_path() / "compute.log"
|
||||
with open(log_path, "r") as log_file:
|
||||
logs = log_file.read()
|
||||
assert "INFO start_compute:apply_config:handle_migrations: Ran 2 migrations" in logs
|
||||
assert "INFO start_compute:apply_config:handle_migrations: Ran 0 migrations" in logs
|
||||
Reference in New Issue
Block a user