Skip to content

Comments

Add Postgress Logger tests#20

Merged
treyburn merged 7 commits intomainfrom
treyburn/postgres-tests
Dec 12, 2025
Merged

Add Postgress Logger tests#20
treyburn merged 7 commits intomainfrom
treyburn/postgres-tests

Conversation

@treyburn
Copy link
Owner

  • Brought in https://github.com/DATA-DOG/go-sqlmock for unit testing the postgres logger
  • Found a couple minor bugs in verifyTableExists()
    • NULL result handling
    • defered rows.Close() on a nil row
  • Realized the Close() method didn't close the db connection. Fixed that as well.

@treyburn treyburn self-assigned this Dec 12, 2025
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.25%. Comparing base (6aa1a3e) to head (3f7f42c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/pkg/logger/postgres.go 89.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #20       +/-   ##
===========================================
+ Coverage   33.07%   59.25%   +26.17%     
===========================================
  Files           5        5               
  Lines         263      270        +7     
===========================================
+ Hits           87      160       +73     
+ Misses        173      103       -70     
- Partials        3        7        +4     

☔ 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.

@treyburn treyburn merged commit b283918 into main Dec 12, 2025
5 checks passed
@treyburn treyburn deleted the treyburn/postgres-tests branch December 12, 2025 22:31
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.

1 participant