-
Notifications
You must be signed in to change notification settings - Fork 317
test: improve test coverage for pkg/integration/gin #969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 Gin transaction middleware, which handles distributed transaction context propagation in HTTP requests. The middleware extracts transaction IDs (XID) from HTTP headers and initializes the Seata transaction context.
Key changes:
- Adds 8 test cases covering various XID header scenarios (primary key, fallback key, precedence, empty values, missing values)
- Includes integration tests with full Gin router setup
- Validates both success and error paths of the middleware
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #969 +/- ##
==========================================
+ Coverage 46.33% 46.38% +0.04%
==========================================
Files 195 196 +1
Lines 11887 11901 +14
==========================================
+ Hits 5508 5520 +12
- Misses 5943 5944 +1
- Partials 436 437 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Which issue(s) this PR fixes:
Fixes #950