test: sanity tests for primary and replica

* new --replica option to `postgrest-with-postgresql-*`
* new command `postgrest-test-replica`
* new sanity tests on test_replica.py
* add postgrest-test-replica to postgrest-check and postgrest-coverage
This commit is contained in:
steve-chavez
2024-04-30 18:35:40 -05:00
committed by Steve Chavez
parent cdb877135b
commit d9a51f23ce
6 changed files with 136 additions and 12 deletions
+21
View File
@@ -45,6 +45,27 @@ def defaultenv(baseenv):
}
@pytest.fixture
def replicaenv(defaultenv):
"Default environment for a PostgREST replica."
conf = {
"PGRST_DB_ANON_ROLE": "postgrest_test_anonymous",
"PGRST_DB_SCHEMAS": "replica",
}
return {
"primary": {
**defaultenv,
**conf,
},
"replica": {
**defaultenv,
**conf,
"PGHOST": os.environ["PGREPLICAHOST"],
"PGREPLICASLOT": os.environ["PGREPLICASLOT"],
},
}
@pytest.fixture
def slow_schema_cache_env(defaultenv):
"Slow schema cache load environment PostgREST."