Open da-tanabe opened 4 years ago
Imho the DAZL developers would appreciate something like dazl.sandbox()
, in order to avoid boilerplate code in their integration tests.
Just an idea: it could even ensure different parties for each test with some extra layer:
sandbox = sandbox_builder.new()
client = sandbox.aio_party() # a brand new party like 'TestParty1'
dazl
is having its third birthday soon, and has consequently evolved over the years and kept up with successive versions of the DAML SDK. The tooling and deployed artifacts had changed dramatically with DAML's open sourcing back in April 2019, butdazl
continues to use an outdated mechanism for running Sandbox that is more inline with what the SDK looked like before that point.Use the official DAML SDK Docker container for running Sandbox.
Many tests require that the Sandbox be running.
dazl
defines a function,dazl.sandbox()
, that makes it easy to start a sandbox from DAML files. It was built under the assumption that Sandbox expects raw DAML files (was the case up until SDK 0.10), and hacked in to support building a DAR transparently from a root DAML file for subsequent versions. This workflow has greatly improved in the DAML SDK itself (daml start
is always sufficient now), butdazl
has not been updated to take advantage of this (and particularly the tests). To fully fix, this means:ResetService
or rewriting the tests to run independently of each other by running as differentParty
's (the latter being preferred).This also enables the python build to be moved off of a combo Java/Python Docker image and instead move to Circle's official Python image, as the tests no longer require the JDK to successfully run (provided the DAML SDK container is running).
This also helps facilitate a full migration off of Bintray/Maven Central:
dazl
downloads individual files that are part of the SDK individually and runs them directly; this mechanism no longer works for newer SDK versions (0.13.41+) so upgrading the tests to newer versions of the DAML SDK are blocked until the mechanism for running Sandbox is changed accordingly.