Helper function that recursively copies all of the contents from
atomic_broadcast
to dst
.
Get the project root (relative to closest Cargo.lock file)
Creates the database backup directory by appending the snapshot_name
to db/migrations
. Then this function will execute the provided
prepare_fn
which is expected to populate the database with the appropriate
data for testing a migration. If the snapshot directory already exists,
this function will do nothing.
Iterates over all of the databases supplied in the database backup
directory. First, a temporary database will be created and the contents will
be populated from the database backup directory. Next, this function will
execute the provided validate
closure. The validate
closure is expected
to do any validation necessary on the temporary database, such as applying
the appropriate database migrations and then reading all of the data to
verify the migrations were successful.