FAI-CIVL / FAI-Airscore

AirScore - online paragliding / hanggliding GAP-based scoring software.
https://airscore.cc/
GNU General Public License v3.0
13 stars 17 forks source link

Unit Tests fail to run #160

Closed kuaka closed 3 years ago

kuaka commented 3 years ago

@biuti hopefully you got an automated email.

The merged code in development is causing the application to fail in the test setup. https://github.com/FAI-CIVL/FAI-Airscore/runs/1418466240?check_suite_focus=true

This is because we are trying to hit the database on app start up (by importing forms that are running queries) Please fix. As we are not using a database for the unit tests, you will need to isolate this code. either use a logical statement to decide if to hit the db (example here: https://github.com/FAI-CIVL/FAI-Airscore/blob/b5e7d5044eb4146ab6bd51d95a5816093fef4b8a/airscore/app.py#L43-L45) or move your import to where it is needed and not the top of the main views file. We need the unit tests to run.

kuaka commented 3 years ago

perhaps an alternative is to run the tests using the local docker-compose which would also test the database setup/ build

biuti commented 3 years ago

I built docker-compose-tests.yml but it seems that it is not affected by changing in local, isn't it? Which compose would be better to test in local without db? docker-compose-dev-local.yml?

kuaka commented 3 years ago

sorry I don't understand the question. If you try to run the tests in docker-compose-tests.yml (sudo docker-compose -f docker-compose-tests.yml run --rm tests test) this should be failing. (as per the GitHub action). I'm not sure what you mean by "changing in local". The code base is the same. It won't be affected by modifications to other docker-compose files obviously.

biuti commented 3 years ago

should be fixed with https://github.com/FAI-CIVL/FAI-Airscore/commit/11daebacd1dd3ab3ec6efaaf733f0f7de8d34133

kuaka commented 3 years ago

I can see that it is now passing. Great