Let the tests choose their database so CI can run PostgreSQL
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 79/100
Research direction
Start with get_settings() and Settings.get_test_settings(), then read fastapi-web-server/tests/.env.test and the two relevant cases in tests/test_settings.py. Check the existing CI workflow and how it provisions services before adding the PostgreSQL job. Done when the environment variable selects PostgreSQL while the unset default uses SQLite, both settings tests pass on either database, and CI logs each passing test.
Written by the indexing model from the issue text.
Description
Problem:
- Under pytest,
get_settings()returnsSettings.get_test_settings(), which reads onlyfastapi-web-server/tests/.env.test. That file points at SQLite. - So an environment variable or a PostgreSQL service container changes nothing: the tests always run on SQLite.
- Forced onto PostgreSQL 18.1 by editing that file, the suite gave 52 passed and 2 failed. Both failures are in
tests/test_settings.pyand assert the SQLite scheme. (Measured at 074f8bb.)
Plan:
- Let one environment variable choose the test database. The default stays SQLite.
- The two settings tests accept either scheme.
- Add a CI job that runs the suite on a pinned PostgreSQL image.
Done when:
- Setting the variable runs the suite on PostgreSQL, and leaving it unset runs it on SQLite
- The two settings tests pass on both
- A CI job runs the suite on PostgreSQL and its log names each passing test
Follows #14.
- Dominant language
- Python
- Stars
- 2
- Forks
- 3
- Avg merge
- 21h 38m
- Merged PRs (30d)
- 11
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pnnl/UUDEX
-
risk:high type:ci
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Read generate-certs.sh defaults from a config filePossibly taken @craigpnnl claimed this 1 day ago. Openrisk:high type:feat
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
risk:high type:fix
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
risk:high type:fix
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Maintainers usually reply within 1 day
-
risk:high type:fix
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dbt-labs/spark-utils#51 ·
-
bug pydanty:is-working
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pydantic/pydantic-ai#13444 ·
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
good first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
changelog investigate
Difficulty 1/5 Under an hour Newbie friendliness 68/100
ramnes/notion-sdk-py#502 ·