SE701-T5 / Backend

Heroku deployed Node.js backend server developed by Team-5 for the UniForum project associated with the University of Auckland SOFTENG 701 course
https://uni-forum.herokuapp.com/
MIT License
2 stars 18 forks source link

Refactor test suite to use mock data instead of the database #81

Open R055A opened 2 years ago

R055A commented 2 years ago

Currently, much of the existing test suite is using a test database and is consistently deleting all data in the database before each test case. This can cause conflict between test cases executed in parallel sharing the same test database resources. This is why the CI workflow is sequentially executing automated testing.

To remove the requirement of a database from the test suite would allow parallel workflow testing, would optimise test performance time, and would resolve the chance of push and pull request event driven CI workflows failing because of conflict between workflows executed by separate events that could share the same resources, such as a commit push event starting a new workflow before another workflow from a prior push event to the same repository branch has completed.

To remove sequential CI testing following removing the requirement of a database for testing, remove occurences of max-parallel: 1 from the .github/workflows/node.js.yml

j-chad commented 2 years ago

this will be partially fixed in #90 and will be finished in a later ticket. The preferred solution is to use an in-memory database