You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tests are currently written in such a way as to depend on the success of previous tests in order to ensure the database is in the proper state. Currently, I am having problems running tests multiple times, as they do not clean up properly. This situation is is undesirable for several reasons:
Tests should always be able to be run stand-alone with no dependencies, this is the point of unit tests.
SBT can run tests in a parallelized fashion, but only if they are isolated. This is especially problematic for our tests since they may refer to the same tables/database schemas. So even if each test makes no assumptions and uses fixtures to set up the database properly, it could still fail if another test "stomps" all of the data it just loaded.
To remedy these:
Fixtures must be created that can put the database into an expected state and then always clean up after the test, even on failure (using try, catch, finally)
For "real" databases, each test should take place in a randomly created schema or alternatively use randomly created table names. Whichever is easier.
SQLite should be modified to use a randomized file name
The text was updated successfully, but these errors were encountered:
The tests are currently written in such a way as to depend on the success of previous tests in order to ensure the database is in the proper state. Currently, I am having problems running tests multiple times, as they do not clean up properly. This situation is is undesirable for several reasons:
Tests should always be able to be run stand-alone with no dependencies, this is the point of unit tests.
SBT can run tests in a parallelized fashion, but only if they are isolated. This is especially problematic for our tests since they may refer to the same tables/database schemas. So even if each test makes no assumptions and uses fixtures to set up the database properly, it could still fail if another test "stomps" all of the data it just loaded.
To remedy these:
Fixtures must be created that can put the database into an expected state and then always clean up after the test, even on failure (using try, catch, finally)
For "real" databases, each test should take place in a randomly created schema or alternatively use randomly created table names. Whichever is easier.
SQLite should be modified to use a randomized file name
The text was updated successfully, but these errors were encountered: