Repository navigation
Verifica a saúde da API antes dos testes de integração - #58
Merged
Merged
Conversation
Uma fixture de sessão chama o GET /ping uma vez antes do primeiro cenário. Com a API fora do ar, cada teste de integração aparece como ERROR com o motivo, sem retry e em segundos (antes: 35 falhas e 35 reruns em mais de 5 minutos). Os testes unitários não passam pela verificação.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumo
api_disponivel(conftest.py): chama oGET /pinguma vez, com oHealthApiClient. Se a API não responder ou não devolver 201, a fixture falha comAPI indisponível em <url>: <motivo>steps/. Não basta acontextdepender dela, porque no pytest-bdd acontextsó é pedida pelos steps, já durante o teste, e a falha apareceria como FAILED em vez de ERRORexcept, para não carregar a exceção de conexão encadeada, que oonly_rerunreconheceria e mandaria repetirAntes e depois, com a API fora do ar
API indisponível em <url>: <motivo>Test plan
mypy .ruff check .ruff format --check .pytestcom a API no ar: 79/79 passandoBASE_URL=http://localhost:9 pytest: 44 passed e 35 errors em 5,6 s, sem rerunsBASE_URL=http://localhost:9 pytest tests/unit: 44 passed, sem a APIBASE_URL=http://10.255.255.1 pytest steps, um endereço que não responde e faz cada chamada esperar 5 s: 35 errors em 6,2 s, o que confirma uma única chamada ao/ping