@@ -44,7 +44,7 @@ The implementation must follow these quality rules for all new and modified test
4444
4545The PR #1695 review branch includes a QA script that defines the expected behavior:
4646
47- - ` run-db- compatibility-matrix.sh ` :
47+ - ` database- compatibility` job in ` .github/workflows/testing.yaml ` :
4848 executes a compatibility matrix across SQLite, multiple MySQL versions, and multiple PostgreSQL
4949 versions.
5050
@@ -88,51 +88,44 @@ Steps:
8888 - PostgreSQL (reserved for subissue #1525 -08): ` TORRUST_TRACKER_CORE_POSTGRES_DRIVER_IMAGE_TAG `
8989
9090 When ` TORRUST_TRACKER_CORE_MYSQL_DRIVER_IMAGE_TAG ` is not set, the test falls back to the
91- current hardcoded default (e.g. ` 8.0 ` ), preserving existing behavior. The matrix script sets
91+ current hardcoded default (e.g. ` 8.0 ` ), preserving existing behavior. The CI matrix job sets
9292 this variable explicitly for each version in the loop, so unset means "run as today" and the
9393 matrix just expands that into multiple combinations.
9494
95- - Add ` contrib/dev-tools/qa/run-db-compatibility-matrix.sh ` modeled after the PR prototype:
96- - ` set -euo pipefail `
97- - define default version sets from env vars:
98- - ` MYSQL_VERSIONS ` defaulting to at least ` 8.0 8.4 `
99- - ` POSTGRES_VERSIONS ` reserved for subissue #1525 -08
100- - run pre-checks once (` cargo check --workspace --all-targets ` )
101- - run protocol/configuration tests once
102- - run SQLite driver tests once
103- - loop MySQL versions: ` docker pull mysql:<version> ` , then run MySQL driver tests with
104- ` TORRUST_TRACKER_CORE_RUN_MYSQL_DRIVER_TEST=1 ` and
105- ` TORRUST_TRACKER_CORE_MYSQL_DRIVER_IMAGE_TAG=<version> `
106- - print a clear heading for each backend/version before executing tests
107- - fail fast on first failure with the failing backend/version visible in logs
108- - keep script complexity intentionally low; avoid re-implementing test logic already in test
109- functions
110- - Replace the current single MySQL ` database ` step in ` .github/workflows/testing.yaml ` with
111- execution of the new script.
95+ - Add a dedicated ` database-compatibility ` workflow job (between unit and e2e) with matrix values for MySQL versions:
96+ - include matrix values for at least ` 8.0 ` and ` 8.4 `
97+ - run ` cargo test -p bittorrent-tracker-core --features db-compatibility-tests run_mysql_driver_tests -- --nocapture `
98+ - set ` TORRUST_TRACKER_CORE_RUN_MYSQL_DRIVER_TEST=true `
99+ - set ` TORRUST_TRACKER_CORE_MYSQL_DRIVER_IMAGE_TAG=<version> `
100+ - keep the test logic in Rust; use workflow matrix for version fan-out
101+ - Replace the current single MySQL ` database ` step in ` .github/workflows/testing.yaml ` with a
102+ dedicated ` database-compatibility ` job.
112103
113104Acceptance criteria:
114105
115106- [ ] DB image version injection is supported via ` TORRUST_TRACKER_CORE_MYSQL_DRIVER_IMAGE_TAG `
116107 (and a reserved ` POSTGRES ` equivalent for subissue #1525 -08).
117- - [ ] ` contrib/dev-tools/qa/run-db- compatibility-matrix.sh ` exists and runs successfully.
118- - [ ] The script exercises SQLite and at least two MySQL versions by default.
108+ - [ ] ` database- compatibility` workflow job runs successfully for each configured MySQL version .
109+ - [ ] The workflow matrix exercises at least two MySQL versions by default.
119110- [ ] Failures identify the backend/version combination that broke.
120- - [ ] The ` database ` job step in ` .github/workflows/testing.yaml ` runs the matrix script instead
121- of a single-version MySQL command.
122- - [ ] The script structure allows PostgreSQL to be added in subissue #1525 -08 without a redesign.
111+ - [ ] The dedicated ` database-compatibility ` job in ` .github/workflows/testing.yaml ` replaces the
112+ old single-version MySQL command.
113+ - [ ] The workflow matrix structure allows PostgreSQL to be added in subissue #1525 -08 without a
114+ redesign.
123115- [ ] Tests do not hard-code host ports; ` testcontainers ` assigns random ports automatically.
124116- [ ] All containers started by tests are removed unconditionally on test completion or failure.
125117
126118### 2) Document the workflow
127119
128120Steps:
129121
130- - Document the local invocation command for the matrix script.
131- - Document that the CI ` database ` step runs the same script.
122+ - Document the local invocation command for the compatibility test using explicit feature + env
123+ vars.
124+ - Document that CI runs the same test through the ` database-compatibility ` workflow job matrix.
132125
133126Acceptance criteria:
134127
135- - [ ] The matrix script is documented and runnable without ad hoc manual steps.
128+ - [ ] The compatibility test command is documented and runnable without ad hoc manual steps.
136129
137130## Out of Scope
138131
@@ -145,13 +138,13 @@ Acceptance criteria:
145138
146139- [ ] ` cargo test --workspace --all-targets ` passes.
147140- [ ] ` linter all ` exits with code ` 0 ` .
148- - [ ] The matrix script has been executed successfully in a clean environment; a passing run log
149- is included in the PR description.
141+ - [ ] The ` database-compatibility ` workflow job has been executed successfully in a clean
142+ environment; a passing run log is included in the PR description.
150143
151144## References
152145
153146- EPIC: #1525
154147- Reference PR: #1695
155148- Reference implementation branch: ` josecelano:pr-1684-review ` — see EPIC for checkout
156149 instructions (` docs/issues/1525-overhaul-persistence.md ` )
157- - Reference script : ` contrib/dev-tools/qa/run-db- compatibility-matrix.sh `
150+ - Reference job : ` .github/workflows/testing.yaml ` ` database- compatibility`
0 commit comments