top | item 23812005

(no title)

alexhornbake | 5 years ago

This is cool, and I applaud the author’s effort. For certain projects this is likely the right way to go.

However, another way to solve this which is safe to use when testing packages in parallel, and let’s you work against your exact database (driver/protocol/version etc)

Each package under test copies the database schema to a new database with the name “{package}_{uuid}”.

TestMain in each package is responsible for: -cleanup of old databases with the same prefix -create a new test database to work against.

Tests within a package are run sequentially, and are responsible for wiping the package’s test DB at the start of each test.

The pattern of “defer cleanup” is avoided in favor of deleting at the start to avoid the edge cases of crashing in the middle of a test run.

discuss

order

No comments yet.