Move tests to the guard-owned SQLite database and default to no database

未关闭
#2,925 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust, sqlite
领域
database, testing

调研方向

Start by reproducing the failures when ephemeral*() configurations have no database, then classify which tests require persistence and which only rely on a helper assumption. Review #2924 for the guard-owned SQLite factory and coordinate package order with the maintainer; migrate tests package by package, excluding packages/tracker-core covered by PR #2923. Done means the old database path helper is removed, startup coverage is listed, and a full run leaves no data_*.db files or files in an empty TMPDIR after #2907.

由索引模型根据 Issue 内容生成。

描述

Parent EPIC: #2392

Goal

No test leaves a data_*.db file behind. Tests that need persistence use the guard-owned SQLite database of #2924, and the ephemeral*() test configurations no longer configure a database. After this issue, a full test run leaves a fresh temporary directory empty.

Background

Every ephemeral*() configuration of torrust-tracker-test-helpers sets a SQLite database at <temp dir>/data_<random>.db, and nothing removes the file. One full test run left 301 such files; about 256 come from these configurations (#2907, #2394 finding F2).

The maintainer decided that ephemeral() may default to no database: a tracker runs without persistence, and tests that need it opt in through a factory that returns a guard the test keeps. With no database in ephemeral(), about 100 tests failed in an experiment, so those are the tests to move.

PR #2923 (#2902) fixes the leak inside packages/tracker-core, so this issue skips that package.

Approach

  • Classify the tests that fail without a database: the test needs persistence, or only a helper assumes it.
  • Move the tests that need persistence to the guard-owned factory, one pull request per package.
  • Then remove the database from the ephemeral*() configurations and remove ephemeral_sqlite_database().
  • List the tests that still cover the SQLite start-up path, because about 180 tests stop exercising it.

Tasks

  • Reproduce and classify; agree the package order with the maintainer.
  • Migrate the tests, one pull request per package.
  • Default to no database and remove the old path helper.
  • Recheck: a full run leaves no data_*.db, and an empty TMPDIR once #2907 is done.

Depends on #2924 (the guard-owned SQLite test database). The full specification is added to docs/issues/open/ by a spec-only pull request.

主要语言
Rust
星标
532
派生
56
平均合并
11 小时 20 分钟
30 天内合并 PR
282

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

torrust/torrust-tracker 的其他 Issue

查看 torrust/torrust-tracker 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。