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

Abierto
#2,925 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust, sqlite
Área
database, testing

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
532
Forks
56
Merge medio
11 h 20 min
PR fusionados (30 d)
282

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de torrust/torrust-tracker

Todos los issues de torrust/torrust-tracker

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.