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

Make integration tests run on CI in parallel with unit tests and caching dependencies #83

Closed lipemorais closed 7 years ago

lipemorais commented 7 years ago

I already tested it on Travis CI and worked as expected, here is the builds on Travis.

What is the purpose of this Pull Request?

The purpose of this PR is make the journey tests run on CI in parallel.

What was done to achieve this purpose?

I moved the tests for journey and unit folders under tests. I change .travis.yml file to run the tests in parallel and cache dependencies. I removed the verification to check env variable before run integration tests

How to test if it really works?

python -m unittest tests/unit python -m unittest tests/journey

Who can help reviewing it?

@cuducos @jtemporal @anaschwendler @Irio

cuducos commented 7 years ago

Wow! Pretty clever — very good indeed.

I'm just wondering… the journey test is kind of hidden, specially for newcomers (as integration tests envvar were before). Thinking of #81 is there a single command to be run that ends up running both unit and journey tests? python -m unittest discover tests runs only 44 tests, so I assumed its unit tests only… am I getting it wrong?

lipemorais commented 7 years ago

@cuducos It happens because there is not __init__.py file inside journey folder. It's kind off good because CEAP journey test takes around 40 minutes(It happened in my Linux at home yesterday) to execute itself.

lipemorais commented 7 years ago

I just executed all the tests here and it took 1703.547s, almost 30 minutes.

cuducos commented 7 years ago

I know it take ages… but… tests exist for a reason. I think people should run ir before opening PRs… that's why I suggested to add it to the default runner (and reinforce people can always use tests/unit for a quick check).