digital-asset / dazl-client

dazl Ledger API client
Apache License 2.0
10 stars 6 forks source link

Migrate build and tests to the latest version of the DAML SDK #75

Open da-tanabe opened 4 years ago

da-tanabe commented 4 years ago

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, but dazl 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), but dazl has not been updated to take advantage of this (and particularly the tests). To fully fix, this means:

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:

richardkapolnai-da commented 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'