daml/compatibility
Samir Talwar 6035840d8a
Upgrade Scala 2.12 to v2.12.13. (#9280)
* Upgrade Scala 2.12 to v2.12.13.

This is being pulled in anyway because of Maven/Gradle/etc's fun
"favor the most recent" resolution mechanism. The version of Akka we
depend upon transitively depends on Scala 2.12.13, so any downstream
consumers will see that as the Scala version required.

Bringing the Daml repo in line means no more confusion.

CHANGELOG_BEGIN
- [Scala Bindings] If you are using Daml on Scala 2.12, it now depends
  on Scala v2.12.13 (from v2.12.12).
CHANGELOG_END

* Scala 2.12.13 is the default version in our pinned version of nixpkgs.

* Upgrade Scala 2.13's Wartremover version.

* Rename `scala_version_rule` to `scala_version_configure`.

* Add a test case to ensure the Scala versions are the same everywhere.

* Add tests for the Scala JAR versions in maven_install_*.json

* gatling-utils: Change the sort order of the expected CSV in tests.

I don't know why this changed, but it seems to be stable.

* compatibility: `scala_version` -> `scala_version_configure`.

* Bazel: Disable the Scala version tests on Windows.

* compatibility: Upgrade Wartremover to Scala 2.12.13.
2021-03-30 11:02:18 +00:00
..
assistant Fix compat job (#9099) 2021-03-11 15:13:49 +00:00
bazel_tools Fix ledger API test tool exclusions (#9264) 2021-03-29 10:29:42 +02:00
head_sdk Fix compat job (#9099) 2021-03-11 15:13:49 +00:00
sandbox-migration LF: release LF 1.12 (#8856) 2021-02-24 21:17:33 +01:00
versions fix (some) copyright headers (#8422) 2021-01-07 11:48:59 +01:00
.bazelignore Extend compatibility tests to test against HEAD (#5714) 2020-04-24 14:43:35 +02:00
.bazelrc Commit compatibility/.bazelrc (#8955) 2021-02-25 19:53:30 +01:00
bazel-haskell-deps.bzl update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
BUILD Temporarily cut compatibility tests with incompatible versions of Daml-LF (#8959) 2021-02-26 13:47:59 +01:00
build-release-artifacts-windows.ps1 Fix compat job (#9099) 2021-03-11 15:13:49 +00:00
build-release-artifacts.sh Fix compat job (#9099) 2021-03-11 15:13:49 +00:00
build-ts-libs.sh update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
deps.bzl Upgrade to Bazel 4.0 (#8798) 2021-02-11 10:08:47 +01:00
maven_install.json Upgrade Scala 2.12 to v2.12.13. (#9280) 2021-03-30 11:02:18 +00:00
README.md Daml case and logo (#8433) 2021-01-08 12:50:15 +00:00
stack-snapshot.yaml Switch to GHC 8.10.3 (#8394) 2021-01-25 11:53:53 +00:00
stackage_snapshot_windows.json Switch to GHC 8.10.3 (#8394) 2021-01-25 11:53:53 +00:00
stackage_snapshot.json Switch to GHC 8.10.3 (#8394) 2021-01-25 11:53:53 +00:00
test-windows.ps1 fix (some) copyright headers (#8422) 2021-01-07 11:48:59 +01:00
test.sh compat: fix killing stale sandbox(es) (#9003) 2021-03-03 15:14:05 +00:00
update-versions.sh update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
versions.bzl update compat versions for 1.12.0-snapshot.20210323.6567.0.90c5ce70 (#9232) 2021-03-24 18:59:56 +01:00
WORKSPACE Upgrade Scala 2.12 to v2.12.13. (#9280) 2021-03-30 11:02:18 +00:00
workspace_status.sh Initial boilerplate for cross-version compatibility testing (#5665) 2020-04-23 12:58:11 +02:00

This directory contains the infrastructure and test setup for cross-version compatibility testing. We make this a separate Bazel workspace to make it easier to enforce that we only depend on release artifacts.

How to

Before using this, make sure to always run the scripts that build the SDK, namely ./build-release-artifacts.sh and ./build-ts-libs.sh. These should be run every time there is a relevant change you want to be there for this workspace to use.

Any Bazel command can then be used afterwards. ./test.sh are the tests run on CI.

What is currently being tested?

We include the following SDK versions in our tests:

  1. All stable SDK versions.
  2. All snapshots x.y.z-snapshot-* for which there is no stable release x.y.z
  3. HEAD.

Since running all tests can be rather slow, we run them in a daily cron job. On each PR we only include HEAD and the latest stable release.

Cross-version compatibility between ledger-api-test-tool

We test that the ledger-api-test-tool of a given version passes against Sandbox next and classic of another version. We test all possible version combinations here to ensure forwards and backwards compatibility. The ledger-api-test-tool includes a DAR built using a compiler from the same SDK version so this also ensures that sandbox can load a DAR from a different SDK version. We test both in-memory backends and postgresql backends.

Since all our JVM ledger clients use the same client libraries we consider the ledger-api-test-tool to be a good proxy and if things are not covered it should be extended.

Data-continuity for Sandbox classic

We have migration tests that work as follows:

  1. Start the oldest Sandbox version and upload a DAR.

  2. Iterate over SDK versions in order. For each version:

    1. Start sandbox of that SDK version.

    2. Run a custom Scala binary that interacts with the ledger to create contracts, exercise choices and query the ACS and the transaction service.

    3. Validates the results. This includes verifying that the transaction streams are the same after the migration and that the ACS is the same + additional test-specific checks.

We have two tests here: One that includes snapshot versions and one that only iterates through stable versions up to HEAD. This ensures that both individual migrations are correct as well as the migrations from one stable version to the next work as a whole.

Backwards-compatibility for Daml Script

We test that the Daml Script runner from a given SDK version can load DARs built against the Daml Script library from an older SDK. We only guarantee backwards compatibility here.

Backwards-compatibility for Daml Triggers

We test that the Daml Trigger runner from a given SDK version can load DARs built against the Daml Script library from an older SDK. We only guarantee backwards compatibility here.

Backwards-compatibility for data-dependencies

We test that we can import DARs built in older SDK versions via data-dependencies. We only test backwards compatibility here.

Cross-version compatibility for create-daml-app

We test that we can run the create-daml-app tests with JS client libraries and codegen from one version against the JSON API and Sandbox from another version. We test all version combinations here. Currently we do not test different versions of the JSON API and Sandbox. This should be covered by the ledger-api-test-tool tests since the JSON API uses the same client libraries.