The main motivator for this PR was that I didn't want flaky or slow tests in the unit tests, and the database tests weren't proper unit tests. So I now moved them to integration tests, but still managed to include them in the code coverage. While I was at it I cleaned up a lot of the CI code as well. The main points I did was:
Changed to use circleci image of MariaDB (this was added recently and means CircleCI will cache it for us, a minor speedup)
Changed to using workspaces in CI as I realized that now we are using npm ci which reinstalls node_modules from scratch every time anyway (but in a really fast fashion) the caching wasn't doing anything anymore as it isn't an incremental command. Also makes the CI code so much cleaner as there is now no longer all those cache restores at the start of every step
Moved database tests to integration tests
Did reruns in a nicer, modularized way, also moved CI specific stuff out of package.json as I didn't find that relevant
Refactored E2E test script and did reruns in a nicer way there as well
Added server logs to be output when E2E tests fail
Also added a timeout for waiting for server to be up
Also added timeouts to all the test commands as Jest has hung some times on async tests, especially E2E and we want the logs!
Updated documentation to reflect the new naming conventions, now name all database files .sql.(j|t)s, the main reason for this is so code coverage can easily include / exclude them.
How Has This Been Tested?
CI passes :)
Screenshots (if appropriate):
N/A
Checklist:
[x] My code follows the code style of this project. (see the style guide)
[x] My change requires a change to the documentation.
[x] I have updated the documentation accordingly.
[x] Coveralls reported increased code coverage, and full coverage for all the code I added / changed (or I have a good reason that I explained above for why this is not the case)
Coverage remained the same at 5.9% when pulling 52a5a60933936cbbf70f71f4be254b0362c350df on emil/refactor-tests into 5f0d8bc409e09d86169faf6ae72b52f21aeb3158 on master.
Related Issue
N/A
Description
The main motivator for this PR was that I didn't want flaky or slow tests in the unit tests, and the database tests weren't proper unit tests. So I now moved them to integration tests, but still managed to include them in the code coverage. While I was at it I cleaned up a lot of the CI code as well. The main points I did was:
.sql.(j|t)s
, the main reason for this is so code coverage can easily include / exclude them.How Has This Been Tested?
CI passes :)
Screenshots (if appropriate):
N/A
Checklist: