Update test

This commit is contained in:
Sasha Krassovsky
2024-01-04 11:15:53 -08:00
committed by Sasha Krassovsky
parent 30064eb197
commit 3c3b53f8ad

View File

@@ -9,19 +9,19 @@ def test_migrations(neon_simple_env: NeonEnv):
endpoint.start()
with endpoint.cursor() as cur:
cur.execute("SELECT last_value FROM neon_migration.migration_id")
cur.execute("SELECT id FROM neon_migration.migration_id")
migration_id = cur.fetchall()
assert migration_id[0][0] == 2
assert migration_id[0][0] == 1
endpoint.stop()
endpoint.start()
with endpoint.cursor() as cur:
cur.execute("SELECT last_value FROM neon_migration.migration_id")
cur.execute("SELECT id FROM neon_migration.migration_id")
migration_id = cur.fetchall()
assert migration_id[0][0] == 2
assert migration_id[0][0] == 1
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 1 migrations" in logs
assert "INFO start_compute:apply_config:handle_migrations: Ran 0 migrations" in logs