Skip to content

ci(tracker-core): add DB compatibility matrix coverage for issue #1703#1705

Merged
josecelano merged 4 commits intotorrust:developfrom
josecelano:1703-1525-01-db-compatibility-matrix
Apr 22, 2026
Merged

ci(tracker-core): add DB compatibility matrix coverage for issue #1703#1705
josecelano merged 4 commits intotorrust:developfrom
josecelano:1703-1525-01-db-compatibility-matrix

Conversation

@josecelano
Copy link
Copy Markdown
Member

Summary

  • add saturation regression tests for large download counters in HTTP and UDP scrape responses
  • add MySQL image-tag injection for tracker-core DB driver tests
  • add a dedicated database-compatibility job between unit and e2e with a MySQL 8.0/8.4 matrix
  • run compatibility tests via Rust test command with explicit env vars and feature-gated compatibility suite
  • update issue spec docs/issues/1703-1525-01-persistence-test-coverage.md to match the implemented workflow

Closes #1703

Copy link
Copy Markdown

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 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-tests feature used by CI.
  • Add a database-compatibility GitHub 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 behind feature = "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.

Comment thread packages/http-protocol/src/v1/responses/scrape.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 93.10345% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.44%. Comparing base (d51ef29) to head (f523745).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...ackages/tracker-core/src/databases/driver/mysql.rs 0.00% 2 Missing ⚠️
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.
📢 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.

…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
@josecelano josecelano force-pushed the 1703-1525-01-db-compatibility-matrix branch from 73aa385 to 6342067 Compare April 22, 2026 10:54
@josecelano
Copy link
Copy Markdown
Member Author

ACK f523745

@josecelano josecelano merged commit c1ebdc7 into torrust:develop Apr 22, 2026
23 checks passed
@josecelano josecelano deleted the 1703-1525-01-db-compatibility-matrix branch April 22, 2026 13:03
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.

feat(persistence): add DB compatibility matrix (#1525-01)

2 participants