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

Dump config through Admin API implementation #3193

Merged
merged 3 commits into from
Feb 6, 2024

Conversation

SkyWriter
Copy link
Contributor

This is a work-in-progress implementation of #3171.

@steve-chavez
Copy link
Member

steve-chavez commented Jan 29, 2024

@SkyWriter The direction looks good. Thanks for the contribution!

We would need to add some tests. The Admin API uses python tests, you can get some inspiration from these:

def test_admin_ready_w_channel(defaultenv):
"Should get a success response from the admin server ready endpoint when the LISTEN channel is enabled"
env = {
**defaultenv,
"PGRST_DB_CHANNEL_ENABLED": "true",
}
with run(env=env) as postgrest:
response = postgrest.admin.get("/ready")
assert response.status_code == 200
def test_admin_ready_wo_channel(defaultenv):
"Should get a success response from the admin server ready endpoint when the LISTEN channel is disabled"
env = {
**defaultenv,
"PGRST_DB_CHANNEL_ENABLED": "false",
}
with run(env=env) as postgrest:
response = postgrest.admin.get("/ready")
assert response.status_code == 200

Then you can run them locally with:

$ nix-shell

$ postgrest-test-io

# you can also choose to run one test with
# $ postgrest-test-io -k name_of_test

@Almaani41
Copy link

Almaani41 commented Jan 29, 2024 via email

@SkyWriter SkyWriter changed the title WIP: Dump config through Admin API implementation Dump config through Admin API implementation Feb 5, 2024
@SkyWriter SkyWriter marked this pull request as ready for review February 5, 2024 23:15
@SkyWriter
Copy link
Contributor Author

@steve-chavez Thank you for the feedback. I think the PR is ready for review. "Loadtest / Loadtest PR (Nix) (pull_request)" automatic check is failing, but this seems to be rather just a CI issue. Let me know if you deem any changes are needed. Otherwise, thanks for running the wonderful project!

Copy link
Member

@steve-chavez steve-chavez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! And yes, the loadtest failure is unrelated. Let's merge 🚀

@steve-chavez steve-chavez merged commit 71887e4 into PostgREST:main Feb 6, 2024
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants