Conversation
maudetes
approved these changes
Jan 8, 2026
Comment on lines
334
to
337
| rmock.head( | ||
| f"{PGREST_ENDPOINT}/migrations_csv", | ||
| f"{config.PGREST_ENDPOINT}/migrations_csv", | ||
| status=postgrest_resp_code, | ||
| ) |
Contributor
There was a problem hiding this comment.
Do we still need this rmock?
Contributor
Author
There was a problem hiding this comment.
I'd say yes, we want to pretend Postgrest has not started, but we could stop mocking the case where Postgrest is in place, as it actually is. I'll try that
Contributor
Author
There was a problem hiding this comment.
I was planning on:
@pytest.mark.parametrize(
"params",
[
(False, ["errors"]),
(True, ["status", "version", "uptime_seconds"]),
],
)
async def test_health(client, rmock, params):
has_postgrest_started, expected_keys = params
if not has_postgrest_started:
rmock.head(
f"{config.PGREST_ENDPOINT}/migrations_csv",
status=503,
)
res = await client.get("/health/")
assert res.status == 200 if has_postgrest_started else 503
res_json = await res.json()
assert all(key in res_json for key in expected_keys)but the migrations_csv table is not set up in this project's container, so the case has_postgrest_started=True fails. So we either:
- create the
migrations_csvtable in this project's setup - keep the current syntax with two mocks
(it also means that the /health/ endpoint is currently only working when tabular is ran on a "real" hydra db)
We can decide and potentially make these changes in a second PR as it would be quite a change on its own.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of running the app in the background, we start the app using
TestServerandTestClient, which will allow us to patch the config before starting the app