Repository navigation
Registra os marcadores TC-XXX a partir dos .feature e confere a matriz - #38
Merged
Merged
Conversation
Os marcadores TC-XXX deixam de ser listados à mão no pyproject.toml e passam a ser registrados no conftest a partir das tags dos .feature. O pytest roda com --strict-markers, para que uma tag com erro de digitação quebre a coleta. Um teste novo garante que docs/test-cases.md lista exatamente os TCs dos .feature, com links para a linha certa de cada cenário.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
5 tasks done
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
tc_scenarios()noconftest.pylê as tags@TC-XXXdos.featuree devolve, para cada TC, o arquivo e a linha do cenário. Opytest_configureregistra um marcador por TC encontrado. Saem as 25 linhas escritas à mão nopyproject.toml--strict-markers: marcador desconhecido passa a quebrar a coleta. Antes, uma tag como@smokgerava só um aviso, e o cenário sumia dopytest -m smokesem ninguém notartests/unit/test_traceability.pygarante quedocs/test-cases.mdlista exatamente os TCs dos.feature(nos dois sentidos), que cada link aponta para a linha doCenárioe que cada tag fica logo acima de um cenário. Roda no jobunit, sem redetc_scenarios()também recusa um mesmo TC em dois cenáriosdocs/test-cases.mdexplicam a conferência automáticaTest plan
mypy .ruff check .ruff format --check .pytest: 56/56 testes passando (53 de antes e 3 de rastreabilidade)pytest --markers: 25 marcadores TC registrados;pytest -m "TC-007 or TC-025"seleciona os 3 testes esperados (o TC-025 tem 2 exemplos)@smokemauth.feature: a coleta quebra com'smok' not found in markers(revertido)test_every_matrix_link_points_to_the_line_of_its_scenariofalha apontando o TC-001 (revertido)