Currently we run all migration tests on a separate postgres
instance. This PR changes this to interleave the steps so that we can
run all tests on a single postgres instance.
We do get slightly worse errors for now but the assertion failures
should be informative enough that I don’t think assigning them to the
test that caused them is an issue (and if it is we can just change the
error message).
changelog_begin
changelog_end
* Factor out generic types from migration tests
This PR factors out `Event` and `Transaction` so we can reuse them for
different tests. To make that work we simply remove the type parameter
from ContractId which didn’t help much anyway and store the undecoded
JSON value in the constructors. The use sites are basically unchanged
thanks to pattern synonyms which match the old constructors.
changelog_begin
changelog_end
* Explain missing package id
changelog_begin
changelog_end
This factors out the parts of the migration runner that are specific
to the current test so we can easily add new tests.
Currently the postgres instance and the model DAR are shared. It’s
easy to separate that and have them be per test. I don’t have strong
feelings on what the right approach here.
changelog_begin
changelog_end
This PR extends the existing sandbox migration tests with a query to
the transaction service before and after running each step and
corresponding validations for that in the migration runner.
changelog_begin
changelog_end
This is preparatory work for hitting the transaction service (and
others but that one is the most important) which isn’t possible via
DAML Script. To ease review, this PR only switches from a DAML Script
to a custom Scala binary. It does not yet change what is tested.
changelog_begin
changelog_end
* Add basic Sandbox data continuity tests
This adds some basic tests that check that data migrations work
properly. For now, I use DAML Script to create and query contracts at
each step. This isn’t perfect since queries can only use the active
contract service but not things like the transaction stream but it’s
clearly better than nothing.
The runner for executing the tests is a simple Haskell executable. It
didn’t really seem useful to throw tasty at this.
I’ve added two sets of tests, one that runs only through stable
versions and one that includes snapshots since migrating through
snapshots is not necessarily equivalent.
Sadly these tests use sandbox-classic since I discovered while writing
these tests that sandbox-next does not actually support migrating data
between SDK versions.
changelog_begin
changelog_end
* Use the sandbox module instead of a custom withSandbox
changelog_begin
changelog_end
* Update compatibility/sandbox-migration/SandboxMigrationRunner.hs
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>