-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
PDS & Feedgen: Testing things that require a database connection #24
Comments
I'm going to take a look into this this weekend, if all works out the way I expect it to! |
Wanted to follow up on this one. As I'm writing a good chunk of code related to ApiErrors, wanted to see if any headway has been made on it. One option could be to setup a docker compose along with the repo that sets up a basic db that can be connected to, as that's what I'm currently doing and that takes very little on system requirements |
Kinda sorta. The original pain point is solved for. I moved the blockstore functions into a trait that is implemented by both an in-memory blockstore and postgresql one. All unit tests for the repo use the in-memory blockstore and tests pass successfully https://github.com/blacksky-algorithms/rsky/actions/runs/13167868697/job/36752588269 If you're looking to test things that need the SqlRepo, you'll still face this issue. If the docker compose option works for local testing and for github actions I'd be cool with that route. |
I'm realistically not going to get to do this as soon as I'd like as some health problems have come up, so please don't wait on me @TheRipperoni |
Sounds good, and yeah I'm looking specifically at the SqlRepo stuff at the moment |
Mainly looking to solve the fact that tests are failing in the CI after deployment due to some tests requiring a database connection. Open to this being a mock database connection of some kind -- will need a way to have records created I think during tests but no persisting after tests complete. Folks doing dev work could hopefully not have to manually set up a bunch of services to be able to build and test things.
The text was updated successfully, but these errors were encountered: