ci(tracker-core): add DB compatibility matrix coverage for issue #1703#1705
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands persistence/driver CI coverage by adding a dedicated database-compatibility job (MySQL matrix) and adds regression coverage for large scrape counters, while updating the related issue spec documentation.
Changes:
- Add UDP scrape counter saturation guard (u32 → i32::MAX) plus a regression unit test.
- Add MySQL image-tag injection for tracker-core MySQL driver tests and gate those tests behind a new
db-compatibility-testsfeature used by CI. - Add a
database-compatibilityGitHub Actions job (MySQL 8.0 / 8.4 matrix) and update issue-spec docs to match the implemented workflow.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/udp-tracker-server/src/handlers/scrape.rs | Saturating conversion helper for UDP i32 counters + regression test. |
| packages/tracker-core/src/databases/driver/mysql.rs | Feature-gate MySQL container tests and allow overriding MySQL image tag via env var. |
| packages/tracker-core/Cargo.toml | Add db-compatibility-tests feature flag for compatibility suite gating. |
| packages/http-protocol/src/v1/responses/scrape.rs | Add regression test ensuring very large downloaded values are encoded. |
| .github/workflows/testing.yaml | Add database-compatibility CI job with MySQL version matrix; e2e now depends on it. |
| docs/issues/1703-1525-01-persistence-test-coverage.md | Update spec to reflect workflow-based matrix approach. |
| docs/issues/1525-overhaul-persistence.md | Point the EPIC step to the updated spec filename. |
Comments suppressed due to low confidence (1)
packages/tracker-core/src/databases/driver/mysql.rs:360
- The inline test instructions below still say the MySQL driver tests are executed with just
TORRUST_TRACKER_CORE_RUN_MYSQL_DRIVER_TEST=true cargo test, but the module is now gated behindfeature = "db-compatibility-tests". Update the instructions to include enabling that feature (so developers can still run these tests locally).
#[cfg(all(test, feature = "db-compatibility-tests"))]
mod tests {
use std::sync::Arc;
use testcontainers::core::IntoContainerPort;
/*
We run a MySQL container and run all the tests against the same container and database.
Test for this driver are executed with:
`TORRUST_TRACKER_CORE_RUN_MYSQL_DRIVER_TEST=true cargo test`
The `Database` trait is very simple and we only have one driver that needs
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1705 +/- ##
===========================================
+ Coverage 86.43% 86.44% +0.01%
===========================================
Files 288 288
Lines 22672 22693 +21
Branches 22672 22693 +21
===========================================
+ Hits 19596 19617 +21
- Misses 2838 2842 +4
+ Partials 238 234 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ust#1703 - Renamed docs/issues/1525-01-persistence-test-coverage.md to docs/issues/1703-1525-01-persistence-test-coverage.md to align the file name with the tracked GitHub issue number - Updated the spec title to include the issue number (torrust#1703) and added a link to torrust#1703 - Updated the spec file reference in docs/issues/1525-overhaul-persistence.md to point to the renamed file
73aa385 to
6342067
Compare
|
ACK f523745 |
Summary
database-compatibilityjob between unit and e2e with a MySQL 8.0/8.4 matrixdocs/issues/1703-1525-01-persistence-test-coverage.mdto match the implemented workflowCloses #1703