Skip to content

Conversation

@stephen-riggs
Copy link
Contributor

This adds a postgres database to the github workflows, with an exposed port. The connection environment variable are then passed onto all tests.

The url and engine for the postgres database are in a new tests/__init__.py file for importing into test files. In tests/conftest.py is a common fixture that can be used to setup the database for all tests, and adds a sample murfey session to it.

As an example of this test setup, I have written tests for the register_grid_square function in the position analysis.

Also fixes a bug in the position analysis where file paths are secured into strings.

@codecov
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 27.28%. Comparing base (7c2a7d9) to head (4c07427).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #465      +/-   ##
==========================================
+ Coverage   27.03%   27.28%   +0.24%     
==========================================
  Files          78       78              
  Lines       10304    10304              
  Branches     1364     1364              
==========================================
+ Hits         2786     2811      +25     
+ Misses       7435     7401      -34     
- Partials       83       92       +9     

Copy link
Contributor

@tieneupin tieneupin left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks so much for figuring out how to implement database testing!

@stephen-riggs stephen-riggs merged commit 7af5b26 into main Jan 28, 2025
15 checks passed
@stephen-riggs stephen-riggs deleted the flush-test branch January 28, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants