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

オープン
#2,925 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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分
マージ済み PR(30日)
282

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

torrust/torrust-tracker のほかの issue

torrust/torrust-tracker の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。