Skip to content

Conversation

@everfid-ever
Copy link
Contributor

Which issue(s) this PR fixes:

Fixes #933

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive test coverage for the datasource initialization functionality. The Init function registers SQL drivers for Seata's AT and XA transaction modes.

  • Adds test file pkg/datasource/init_test.go with 23 test functions and 4 benchmark functions
  • Implements thread-safe test initialization using sync.Once to handle non-idempotent Init() function
  • Tests driver registration, persistence, concurrency, and uniqueness

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.50%. Comparing base (0747d09) to head (5c09a7e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #973   +/-   ##
=======================================
  Coverage   48.49%   48.50%           
=======================================
  Files         199      200    +1     
  Lines       12329    12331    +2     
=======================================
+ Hits         5979     5981    +2     
  Misses       5880     5880           
  Partials      470      470           

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

@slievrly slievrly added this to the 2.1.0 milestone Nov 5, 2025
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

@everfid-ever There are no new cover lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve test coverage for pkg/datasource

3 participants