Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

tests: test infrastructure (setup/teardown) improvements

Abierto
#1,348 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Refactorización
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
python
Área
testing-qa

Línea de trabajo

Empieza leyendo Modified_Testcase y la discusión sobre la infraestructura de pruebas de #1346 para identificar los patrones existentes de setup y teardown. Compara cómo las pruebas crean, sirven, exponen y eliminan repositorios y directorios temporales. Se considera terminado cuando el enfoque compartido cubre los repositorios a nivel de clase y de instancia sin una limpieza repetida o poco fiable.

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

Descripción

enhancement testing

(Documenting test improvement ideas from #1346)

A lot (most?) of our tests require a test server (or several). This typically means moving metadata from sources to a temp directory, serving the temp directory and finally removing the temporary directories. Modified_Testcase handles parts of that but it seems obvious that A) it does not provide the required functionality (as tests re-implement a lot of it) and B) that it is hard to use correctly (as #1346 and many previous issues prove). The end result is that there are temp directories created inside tempdirectories and then those directories may or may not get removed (often in a fairly random order)

The common needs are these I think:

  • Test class must be able to serve a repository that all its tests run against
  • test instance must be able to serve it's own repository (because it wants to modify the contents)
  • the served repository paths must be exposed so the content can be modified during test

We could have a better Modified_Testcase that just always runs one test server per class, and provides helpers to "intitialize a new repo" (copy files from sources into a directory inside the served directory). This way both server startup/shutdown and tempdir management would be handled in one place: the actual test classes would only have to remember to chain up Setup*() and *Teardown() -- if they even need those when Modified_Testcase is better.

Lenguaje dominante
Python
Estrellas
1.7k
Forks
304
Merge medio
1 d 2 h
PR fusionados (30 d)
17

Preparar el entorno

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 theupdateframework/python-tuf

Todos los issues de theupdateframework/python-tuf

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.