augustin-wien / augustina-backend

An open-source web shop designed for selling magazines on the street.
GNU Affero General Public License v3.0
4 stars 0 forks source link

Update handlers_test.go #66

Closed jofmi closed 12 months ago

jofmi commented 1 year ago

Type of change

Description

Add test to check if balances are updated after order is verified

Checklist:

lebe1 commented 12 months ago

Hi @jofmi, I just pushed a commit to fix a testing error, which lead to a different testing in test_payments(). Do you think we might have a similar problem here due to parallel running tests asking the test_DB how many payments have been done, which can differ depending what tests ran before? Also I fixed test_orders with a complete different balance check as you can see above in my review comment...

jofmi commented 12 months ago

Hi @jofmi, I just pushed a commit to fix a testing error, which lead to a different testing in test_payments(). Do you think we might have a similar problem here due to parallel running tests asking the test_DB how many payments have been done, which can differ depending what tests ran before?

The problem seems to be that the EmptyDb command is not working in the CI. You can see in the test logs that it says before each test: {"level":"info","ts":1695736373.1417243,"caller":"database/db.go:134","msg":"Database already initialized"}. But it should be impossible that the Database is already initialized if it has been emptied.

jofmi commented 12 months ago

Since we now know that the problem is not about parallelism, I fixed the error by deleting the data from the test at the end of the test