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

Đang mở
#2,925 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust, sqlite
Lĩnh vực
database, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
532
Fork
56
Merge trung bình
11 giờ 20 phút
Pull request đã merge (30 ngày)
282

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của torrust/torrust-tracker

Tất cả issue của torrust/torrust-tracker

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.