Skip to content

Commit 844883b

Browse files
committed
test: only run on pg 15 for this test, as 1.3.1 limited to 15
1 parent 8cd2f5a commit 844883b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

testinfra/test_ami_nix.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ def gzip_then_base64_encode(s: str) -> str:
226226
- {{path: /etc/gotrue.env, content: {gzip_then_base64_encode(gotrue_env_content)}, permissions: '0664', encoding: gz+b64}}
227227
- {{path: /etc/wal-g/config.json, content: {gzip_then_base64_encode(walg_config_json_content)}, permissions: '0664', owner: 'wal-g:wal-g', encoding: gz+b64}}
228228
- {{path: /tmp/init.json, content: {gzip_then_base64_encode(init_json_content)}, permissions: '0600', encoding: gz+b64}}
229-
- {{path: /root/pg_extensions.json, content: {gzip_then_base64_encode('{"pg_cron":"1.3.1"}')}, permissions: '0644', encoding: gz+b64}}
230229
runcmd:
231230
- 'sudo echo \"pgbouncer\" \"postgres\" >> /etc/pgbouncer/userlist.txt'
232231
- 'cd /tmp && aws s3 cp --region ap-southeast-1 s3://init-scripts-staging/project/init.sh .'
232+
- 'if [ "$POSTGRES_MAJOR_VERSION" = "15" ]; then echo \'{"pg_cron":"1.3.1"}\' | sudo tee /root/pg_extensions.json && sudo chmod 644 /root/pg_extensions.json; fi'
233233
- 'bash init.sh "staging"'
234234
- 'rm -rf /tmp/*'
235235
""",
@@ -480,6 +480,11 @@ def test_postgrest_ending_empty_key_query_parameter_is_removed(host):
480480

481481

482482
def test_pg_cron_extension(host):
483+
# Only run this test for PostgreSQL 15
484+
postgres_version = os.environ.get("POSTGRES_MAJOR_VERSION")
485+
if postgres_version != "15":
486+
pytest.skip(f"Skipping pg_cron test for PostgreSQL version {postgres_version}")
487+
483488
# Connect as supabase_admin and create the extension
484489
with host.sudo("postgres"):
485490
result = host.run('psql -U supabase_admin -d postgres -c "CREATE EXTENSION pg_cron WITH SCHEMA pg_catalog VERSION \'1.3.1\';"')

0 commit comments

Comments
 (0)