Commit Graph

18 Commits

Author SHA1 Message Date
Moritz Kiefer
ec8c209b65
Include sadbonx-classic in compatibility tests (#6399)
Given that sadbonx-classic came back from the dead my initial
reasoning that we don’t have to include it since it will be gone soon
anyway is obsolete. Therefore, this PR adds both the in-memory and
postgresql variant to the ledger-api-test-tool tests. For other tests,
I did not yet create variants for sadbonx-classic. Not sure how
important that is, we can always add it later.

changelog_begin
changelog_end
2020-06-19 15:55:39 +02:00
Andreas Herrmann
2628e1857e
Validate data-dependencies test DARs (#6320)
* Validate data-dependencies test DARs

In addition to building the coin upgrade DAR with data-dependencies on
the coin1 and coin2 packages built with an older SDK, this will also
define cases that run `damlc validate-dar` on the compiled coin upgrade
package.

changelog_begin
changelog_end

* fmt

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-06-12 17:21:00 +00:00
Stefano Baghino
2fc2237989
Add migration test for contract key transfers (#6298)
* Add migration test for contract key transfers

Fixes #6238

changelog_begin
changelog_end

* Complete transaction verification

* Remove unnecessary bits

* Address https://github.com/digital-asset/daml/pull/6298#discussion_r439242912

* Address https://github.com/digital-asset/daml/pull/6298#discussion_r439244897

* Address https://github.com/digital-asset/daml/pull/6298#discussion_r439246799

* Address https://github.com/digital-asset/daml/pull/6298#discussion_r438779291

* Address https://github.com/digital-asset/daml/pull/6298#discussion_r438784947

* shut up buildifier

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-06-12 12:29:27 +00:00
Andreas Herrmann
f2cd820f42
Add data-dependencies compatibility tests (#6313)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-06-12 09:48:53 +02:00
Andreas Herrmann
61d181d22c
Setup compatibility tests for DAML Trigger (#6112)
* Build CopyTrigger example in compatibility

* Test DAML trigger with test DAML script

Defines a custom client script that runs the trigger runner in the
background and uses a DAML script in the foreground to test that the
trigger runs and its effects are observable.

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Use bazel_tools:versions.bzl%versions.is_at_least

Also align versions.is_at_least|most with skylib

The arguments to the Skylib function are in the opposite order. I've
included a docstring to explain

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-05-27 12:32:37 +00:00
Moritz Kiefer
34ae06414e
Speed-up create-daml-app compat tests (#6087)
Previously we ran `daml codegen js` and `daml build` in the tests and
we also ran it twice. While this makes sense for the SDK integration
tests, it doesn’t really make sense for the compatibility tests. These
are SDK-only features so they don’t actually test compatibility. These
steps are super slow and running them in the tests also means that we
run them a quadratic number of times.

This PR moves the `daml build` and the `daml codegen js` step to
separate genrules. In the actual test, the only expensive steps are to
run `yarn install` and the actual jest tests. In principle, we could
probably try to factor out the `yarn install` step as well but I’m a
bit scared of coyping around node_modules so I’ll not attempt to do
that for now.

changelog_begin
changelog_end
2020-05-25 16:25:10 +02:00
Moritz Kiefer
8bc00ee8e6
Print the postgres log on failures (#5860)
This changes the code for starting postgres to print the log if
`pg_ctl start` fails.

In addition to that it marks the migration tests exclusive since they
rely on this code which has a hardcoded port number.

I tested this on CI by temporarily disabling --quick.

changelog_begin
changelog_end
2020-05-06 10:22:56 +00:00
Moritz Kiefer
0c90844184
Update SDK versions in compatibility tests (#5844)
* Update SDK versions in compatibility tests

This adds a Haskell script to generate a versions.bzl file that
contains the list of versions as well as their hashes. This should
make it a bit easier to keep things up2date going forward.

The script is a bit slow since downloading all the SDKs takes quite a
while but for now it should be good enough and is much more pleasant
than having to figure this out manually.

changelog_begin
changelog_end

* Address review comments

changelog_begin
changelog_end

* Fix excluded tests

changelog_begin
changelog_end
2020-05-05 19:40:03 +02:00
Moritz Kiefer
6bf0996bf1
Add basic Sandbox data continuity tests (#5826)
* 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>
2020-05-05 14:46:58 +02:00
Andreas Herrmann
52199f5c17
Setup compatibility tests for DAML Script (#5825)
* daml new script-example

* Build DAML script DAR

* daml_script_dar macro over sdk_version

* Run an individual daml-script test

* DAML script test matrix

* format

CHANGELOG_BEGIN
CHANGELOG_END

* Use named arguments on daml_script_test

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-05-05 10:33:32 +00:00
Moritz Kiefer
49e19ebed1
Make compat tests work on windows (#5732)
* Make compat tests work on windows

This required some changes to the daml_sdk rule since the read-only
installation by the assistant breaks Bazel completely. We could only
apply those changes on Windows but I think I prefer the consistency
across platforms here over trying to stay close to how the SDK is
installed on user machines given that the SDK installation is not
something we’ve had issues with.

I’ve excluded the postgresql tests for now. I don’t expect them to be
particularly hard to fix but I’ve already spent almost 2 days on this
and having some tests run on Windows seems like a clear improvement
over running no tests on Windows :)

changelog_begin
changelog_end

* Remove todo

changelog_begin
changelog_end
2020-04-28 16:06:36 +02:00
Gary Verhaegen
7ceda5678a
run compatibility tests on macos (#5723)
This PR extends the existing Linux compatibility tests to run on macOS
too. Fixes #5692.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-04-27 14:55:16 +02:00
Moritz Kiefer
0d1f21e4a2
Extend compatibility tests to test against HEAD (#5714)
fixes #5691

changelog_begin
changelog_end
2020-04-24 14:43:35 +02:00
Moritz Kiefer
7f2a950da0
Fix ./fmt.sh check (#5718)
* Fix ./fmt.sh check

We accidentally introduced hlint lints when we added the compatibility
workspace. The hlint code in ./fmt.sh correctly detects that there is
a hint but then exits with 0 since it uses the exit code from `echo`
rather than the one from `hlint`. The info that we printed with
`echo` didn’t actually make any sense so I added a new comment as to
why we run hlint here. This requires some setup changes so that the
compatibility workspace gets the same Haskell flags since otherwise
using the same hlint rules obviously does not make sense.

Fixes #5701

changelog_begin
changelog_end

* Update fmt.sh

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-04-24 12:04:14 +00:00
Moritz Kiefer
bed6a2ed51
Include latest snapshot in compatibility tests (#5709)
changelog_begin
changelog_end
2020-04-24 12:21:28 +02:00
Moritz Kiefer
df16cf7094
Extend compatibility tests to DAML on SQL (#5705)
* Extend compatibility tests to DAML on SQL

This feels a bit hacky since the runfiles don’t work quite like I
would expect them to but it’s at least not more hacky than what we do
for the head-based tests we currently have.

Progress towards #5695

changelog_begin
changelog_end

* Fix runfiles with more bash

changelog_begin
changelog_end

* remove redundant port options

changelog_begin
changelog_end

* Create fewer sandbox targets

changelog_begin
changelog_end

* Apply suggestions from code review

Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* Fix runfiles snippet

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2020-04-24 12:08:32 +02:00
Andreas Herrmann
c08672a300
Define a simple test matrix for SDK/platform tests (#5699)
* Abstract over SDK/platform client_server_test

* Define test-matrix using simple list comprehension

CHANGELOG_BEGIN
CHANGELOG_END

* copy right header

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-04-23 12:46:22 +00:00
Moritz Kiefer
7d36402412
Initial boilerplate for cross-version compatibility testing (#5665)
This is a first step towards testing cross-version
compatibility. It doesn’t actuall do much yet but hopefully it should
be easier to parallelize once we have the initial boilerplate in place
so ideally I’d like to address most missing things and issues in
separate PRs.

changelog_begin
changelog_end
2020-04-23 12:58:11 +02:00