Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence noisy db-tests runs #1548

Open
skovati opened this issue Sep 4, 2024 · 1 comment
Open

Silence noisy db-tests runs #1548

skovati opened this issue Sep 4, 2024 · 1 comment
Labels
database Anything related to the database test Adding missing tests, correcting existing tests, or test infrastructure

Comments

@skovati
Copy link
Contributor

skovati commented Sep 4, 2024

When running :db-tests:e2eTests, init_*.sql files are run over and over again, since we entirely clear out DB schemas after each test class. Some artifacts aren't being cleaned up correctly though, so psql emits warnings that either there is a transaction in progress:

psql:./aerie/deployment/postgres-init-db/sql/init_permissions.sql:8: WARNING:  there is already a transaction in progress
psql:./aerie/deployment/postgres-init-db/sql/init_db_users.sql:28: WARNING:  no privileges could be revoked for "public"

Additionally, it looks like env vars for permission users aren't being passed / substituted correctly, since we get a sql syntax error:

psql:./aerie/deployment/postgres-init-db/sql/init_db_users.sql:34: ERROR:  syntax error at or near ":"
LINE 1: ...ant select on all tables in schema permissions to :"gateway_...

Weirdly, this doesn't cause any failing tests, but is certainly leaky and incorrect to some extent.

@skovati skovati added test Adding missing tests, correcting existing tests, or test infrastructure database Anything related to the database labels Sep 4, 2024
@Mythicaeda
Copy link
Contributor

The transaction in progress warning is likely because the sub-init files are wrapped in begin; end;. Removing these wrappers or having them declare subtransactions instead should resolve them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Anything related to the database test Adding missing tests, correcting existing tests, or test infrastructure
Projects
Status: Todo
Development

No branches or pull requests

2 participants