Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

tests: test infrastructure (setup/teardown) improvements

Aberta
#1,348 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 10 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
25/100
Tipo de issue
Refatoração
Clareza
Precisa de esclarecimento
Status de atividade
Estagnada
Stack de tecnologia
python
Domínio
testing-qa

Direção de pesquisa

Comece lendo Modified_Testcase e a discussão sobre a infraestrutura de testes de #1346 para mapear os padrões existentes de setup e teardown. Compare como os testes criam, servem, expõem e removem repositórios e diretórios temporários. O trabalho estará concluído quando a abordagem compartilhada abranger repositórios em nível de classe e de instância sem limpeza repetida ou não confiável.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Python
Estrelas
1.7k
Forks
304
Merge médio
9h 25min
PRs com merge (30d)
14

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de theupdateframework/python-tuf

Todas as issues de theupdateframework/python-tuf

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.