open-duelyst / duelyst

Duelyst is a digital collectible card game and turn-based strategy hybrid, developed by Counterplay Games.
Creative Commons Zero v1.0 Universal
3.65k stars 561 forks source link

[P1] Repair and enable disabled integration tests #48

Open willroberts opened 2 years ago

willroberts commented 2 years ago

As of #47, we are running integration tests in Github Actions. However, we are only running a subset of the available tests. We should repair the following tests and enable them in .github/workflows/integration_tests.yaml:

yarn test:integration:data_access: All of these tests are failing due to misuse of Knex in the Users module:

  14) users module
       "before all" hook in "users module":
     TypeError: knex(...).where(...).first(...).bind is not a function
    at Function.UsersModule.createNewUser (server/lib/data_access/users.coffee:138:4)

yarn test:integration:firebase: In order to run Firebase tests, we need to create a Firebase Realtime Database which can be used by Github Actions.

There are also tests which are commented out and need to be reworked, either because they were broken or because they were too slow:

% git grep -l 'Test disabled'
test/integration/achievements/collector_supreme.js
test/integration/achievements/home_turf.js
test/integration/achievements/seven_sisters.js
test/integration/data_access/cosmetic_chests.js
test/integration/data_access/inventory.js
test/integration/data_access/migrations.js
test/integration/data_access/rift.js
test/integration/data_access/users.js
willroberts commented 2 years ago

It also looks like test/integration/misc can be moved to test/unit, since they have no dependencies to integrate with.

willroberts commented 2 years ago

I believe this is part of why some integration tests hang: https://github.com/redis/node-redis/tree/v.2.8.0#clientunref