Repository navigation
feat(test-helpers): [#2924] add a guard-owned SQLite test database - #3029
Merged
josecelano merged 2 commits intoNov 24, 2026
Merged
josecelano merged 2 commits into
josecelano merged 2 commits into
Conversation
…its factory SqliteDatabaseGuard owns a temporary directory for a test's SQLite file and removes it on drop, even when the test panics. ephemeral_with_sqlite_database() returns a configuration pointing at that file together with the guard. ephemeral() and the other ephemeral*() functions are unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e a guard directory The only direct caller of ephemeral_sqlite_database() outside tracker-core now derives its never-created path from a SqliteDatabaseGuard directory. V2 recheck and the T3 design approval are recorded in the spec evidence. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
josecelano-bot
temporarily deployed
to
coverage
November 24, 2026 13:52 — with
GitHub Actions
Inactive
Member
|
ACK b6b4fc4 |
josecelano
pushed a commit
that referenced
this pull request
Nov 24, 2026
Issue #2924 is closed on GitHub (PR #3029 merged). Moves its spec folder to docs/issues/closed/, marks it done, ticks the checkpoints and acceptance criteria with their evidence, and repairs the live links to it in EPIC #2392 (links only) and in the #2907 and #2925 specs. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
josecelano
added a commit
that referenced
this pull request
Nov 25, 2026
9363083 docs(pr-reviews): [#2392] audit review round 4 of PR 3045 (josecelano-bot) 7acac34 docs(pr-reviews): [#2392] restore the rewritten log entries of PR 3045 and name the right head (josecelano-bot) 91b41a7 docs(pr-reviews): [#2392] say the round 3 thread was already resolved (josecelano-bot) 7e81b3e docs(pr-reviews): [#2392] audit review rounds 2 and 3 of PR 3045 (josecelano-bot) f0e99af docs(issues): [#2392] log the attribution change as its own entry (josecelano-bot) d53c9f0 docs(issues): [#2392] say the six-file attribution follows from excluding the direct caller (josecelano-bot) 9d5e905 docs(pr-reviews): [#2392] correct the round 1 log of PR 3045 (josecelano-bot) 6f446d7 docs(issues): [#2392] record order 9 as done in the AC2 evidence (josecelano-bot) e1c4344 docs(pr-reviews): [#2392] audit review round 1 of PR 3045 (josecelano-bot) b27f66c docs(issues): [#2392] scope the recheck count of order 9 to http-core (josecelano-bot) 721d594 docs(issues): [#2392] mark order 9 (#2924) done (josecelano-bot) Pull request description: Syncs the EPIC #2392 spec (`docs/issues/open/2392-test-isolation/EPIC.md`) after #2924 closed. - Order 9 (#2924) is now DONE, with PRs #3011 (spec), #3029 (guard, factory and the `http-core` conversion) and #3035 (close-out). The row no longer says order 9 starts after #2923 merges. - Adds three progress-log entries and records in the AC2 evidence that order 9 is done. They record that the `http-core` recheck still counts 6 `data_*.db` files, which, by elimination of the one direct caller, come from `ephemeral*()` users that order 10 (#2925) moves (no per-test attribution), and that `tracker-core` keeps its own `EphemeralConfiguration` wrappers with no subissue owning their adoption of the shared type yet. - Bumps `last-updated-utc`. AC1 is unchanged: it waits for the maintainer to link #2924, #2925 and #2943 as sub-issues. ## Validation - `linter all` passes. - The pre-commit and pre-push hooks pass. Related to #2392 Related to #2924 🤖 Generated with [Claude Code](https://claude.com/claude-code) ACKs for top commit: josecelano: ACK 9363083 Tree-SHA512: badd1e5997af963bb759cf462392ca964aeb731351eda8eea63f5f6b4b7ff0197715adf7b117e5162ac915ef90d71d31ba3bfcc41fcd7d380028f445385c72a4
josecelano
pushed a commit
that referenced
this pull request
Nov 25, 2026
Contributor
|
Post-merge note: this pull request requested a review from this account and was closed without one at its final head. A post-merge review will not be done: All 119 executable lines it added are tests, benchmarks or test support with no production behaviour, and 119 of them are still present. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2924. Part of EPIC #2392.
Summary
Adds a guard-owned SQLite test database to
torrust-tracker-test-helpersand converts the one direct caller outsidetracker-core.SqliteDatabaseGuardowns a temporary directory for a test's SQLite file and deletes it on drop, even when the test panics. It is independent of any test environment, so a restart test can share one guard between two environments. The doc comment explains why the type is called a "guard" (RAII guard idiom).ephemeral_with_sqlite_database() -> (Configuration, SqliteDatabaseGuard)returns a configuration pointing at the guard's database file.ephemeral()and the otherephemeral*()functions are unchanged.ephemeral_sqlite_database()stays until Move tests to the guard-owned SQLite database and default to no database #2925.tracker-corekeeps its own wrappers.http-coretestit_should_panic_when_the_configured_database_cannot_be_initializednow builds its never-created path inside a guard directory.Files and packages
packages/test-helpers:src/configuration.rs(guard, factory, 6 unit tests) andCargo.toml(tempfile).packages/http-core/src/container.rs: the converted test.docs/issues/open/2924-2392-sqlite-test-database-guard/: spec progress (T3 to T5, V2) andmanual-verification-evidence.md(T3 red check, design approval, V2).Validation
cargo test -p torrust-tracker-test-helpers: 8 tests pass. Red check by mutation: pointing the factory atephemeral_sqlite_database()made the two factory tests fail.cargo test -p torrust-tracker-http-core: the converted test passes.TMPDIR,cargo +stable test -p torrust-tracker-http-core --all-targets --all-features, countdata_*.db) still count 6 files. This is expected: T2 found the converted caller never created a file, and the 6 files come from theephemeral*()configurations, which are out of scope (Move tests to the guard-owned SQLite database and default to no database #2925). The cleanup behaviour is covered by the guard's unit tests.linter all) passes.🤖 Generated with Claude Code