Skip to content

DB - Fix session handling for context method#185

Merged
jomey merged 2 commits into
release-0.6.xfrom
db_transactions
Jun 10, 2025
Merged

DB - Fix session handling for context method#185
jomey merged 2 commits into
release-0.6.xfrom
db_transactions

Conversation

@jomey

@jomey jomey commented Jun 5, 2025

Copy link
Copy Markdown
Member

The db_session_with_credentials helper method did not properly close the active session once a query was executed. This method was first used in the snowex_db library and caused tests to hang when trying to tear down test data between class runs.

The `db_session_with_credentials` helper method did not properly close
the active session once a query was executed. This method was first used
in the snowex_db library and caused tests to hang when trying to
tear down test data between class runs.
@jomey jomey requested a review from aaarendt June 5, 2025 17:44
Pytest 8.4 has an interface change that breaks compatibility with
factory-boy<4
@codecov

codecov Bot commented Jun 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.92%. Comparing base (bda2d70) to head (2d97f34).
⚠️ Report is 16 commits behind head on release-0.6.x.

Additional details and impacted files
@@                Coverage Diff                @@
##           release-0.6.x     #185      +/-   ##
=================================================
+ Coverage          75.80%   75.92%   +0.11%     
=================================================
  Files                 21       21              
  Lines                649      652       +3     
=================================================
+ Hits                 492      495       +3     
  Misses               157      157              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aaarendt aaarendt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just noting that after I run the test suite for snowex_db the entire db is dropped, whereas in snowexsql the tables remain (empty). I'm unclear on what is the preferred behavior. Wondering if there's value in unifying the db deployment for testing across both repos?

@jomey

jomey commented Jun 10, 2025

Copy link
Copy Markdown
Member Author

Just noting that after I run the test suite for snowex_db the entire db is dropped, whereas in snowexsql the tables remain (empty). I'm unclear on what is the preferred behavior. Wondering if there's value in unifying the db deployment for testing across both repos?

I have that on the low priority list to migrate the snowex_db test DB setup to a similar architecture. There are a couple of more differences (for example using transactions or using DB fixtures in snowexsql) that would be good to do as well in one push.

@jomey jomey merged commit fc51d6a into release-0.6.x Jun 10, 2025
9 checks passed
@jomey jomey deleted the db_transactions branch June 10, 2025 17:07
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.

2 participants