okfn-brasil / serenata-toolbox

📦 pip module containing code shared across Serenata de Amor's projects | ** Este repositório não recebe atualizações frequentes **
MIT License
154 stars 69 forks source link

Could we use Pytest to help address the problems with total testing time for journey tests? #140

Closed lipemorais closed 7 years ago

lipemorais commented 7 years ago

What is the problem? Journey tests takes too long to run.

screen shot 2017-08-31 at 19 08 24

How can this be addressed? I believe that the --durations of Pytest can help us understand what is going on, which test. Like in the image below:

screen shot 2017-08-31 at 19 10 34

Who could help with this issue? I could address it by myself but I'm open to have someone working on it with me.

Labels [question]

Want to try it by yourself? $ pip install pytest pytest --verbose --duration=10 tests/unit/

This command will run the tests under tests/unit folder show on a terminal report the 10th that takes more time to run.

cuducos commented 7 years ago

I'd love to see pytestaround however I still think that the problem of journey is clearcut: we literally download more than 2MM reimbursements from the government serves. This is not what tests are for.

If we mock this downloads with useful subsets of real data ad fixtures, the waiting time is fixed IMHO.

lipemorais commented 7 years ago

@cuducos I completely agree with you. We need to start somewhere. I see this as very effective way to prioritize which tests attack first and will give us more return over our investment.

What do you think, @cuducos and @jtemporal ?

cuducos commented 7 years ago

Nothing against pytest, feel free to go on ; )

cuducos commented 7 years ago

Closed by #142