Description: To increase test efficiency, I would like to test database connectivity before running and database unit/integration tests and, if the connection fails, I want the test suite to skip all remaining tests
Prerequisites: none
Design:
In #91 I experimented with this a lot and could not accomplish this. However, this may have been due to my API methods not returning responses like they should have been.
My original idea here was to try connecting to the database within the BeforeAll phase and set a private flag to prevent processing DB-based unit tests. Using a BeforeAll method is supposed to work properly using newer versions of jest (which now uses jest-circus as a test runner) so I should try that once again now that API methods are responding correctly
This may not work because description nodes may be processed before anything else. If this is the case, I could try a couple of things:
try reordering the blocks so that one containing the DB connection test occurs before the ones that use the connection. They should be processed in order. I can then hopefully use the flag I set to skip the DB tests
only put my non-DB tests and an initial DB connection test into description blocks and leave the other tests outside of description blocks. I can then hopefully use the flag I set to skip the DB tests
The problem in my previous attempts to implement this was that the callback that happens after the connection error occurs did not happen until after everything else completed, but this might not happen now that the API endpoints respond correctly.
Test Plan:
adjust the unit tests to have incorrect SQL connection info (eg. bad user name) and run all tests.
All non-DB tests should complete and pass
The connection failure should occur and output an appropriate message
Description: To increase test efficiency, I would like to test database connectivity before running and database unit/integration tests and, if the connection fails, I want the test suite to skip all remaining tests
Prerequisites: none
Design:
This may not work because description nodes may be processed before anything else. If this is the case, I could try a couple of things:
Test Plan:
adjust the unit tests to have incorrect SQL connection info (eg. bad user name) and run all tests.