2020-04-23 13:58:11 +03:00
|
|
|
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2020-04-27 15:55:16 +03:00
|
|
|
load("@os_info//:os_info.bzl", "is_windows")
|
2020-05-25 17:25:10 +03:00
|
|
|
load("//bazel_tools:testing.bzl", "create_daml_app_codegen", "create_daml_app_dar", "sdk_platform_test")
|
2020-05-05 13:33:32 +03:00
|
|
|
load(
|
|
|
|
"//bazel_tools/daml_script:daml_script.bzl",
|
|
|
|
"daml_script_dar",
|
|
|
|
"daml_script_test",
|
|
|
|
)
|
2020-05-27 15:32:37 +03:00
|
|
|
load(
|
|
|
|
"//bazel_tools/daml_trigger:daml_trigger.bzl",
|
|
|
|
"daml_trigger_dar",
|
|
|
|
"daml_trigger_test",
|
|
|
|
)
|
2020-06-12 10:48:53 +03:00
|
|
|
load(
|
|
|
|
"//bazel_tools/data_dependencies:data_dependencies.bzl",
|
|
|
|
"data_dependencies_coins",
|
2020-06-12 20:21:00 +03:00
|
|
|
"data_dependencies_upgrade_test",
|
2020-06-12 10:48:53 +03:00
|
|
|
)
|
2020-05-27 15:32:37 +03:00
|
|
|
load("//bazel_tools:versions.bzl", "versions")
|
2020-05-05 15:46:58 +03:00
|
|
|
load("//sandbox-migration:util.bzl", "migration_test")
|
2020-05-05 20:40:03 +03:00
|
|
|
load("//:versions.bzl", "platform_versions", "sdk_versions", "stable_versions")
|
2020-05-25 17:25:10 +03:00
|
|
|
load("@daml//bazel_tools:haskell.bzl", "da_haskell_binary")
|
2020-04-23 13:58:11 +03:00
|
|
|
|
2020-04-24 15:04:14 +03:00
|
|
|
config_setting(
|
|
|
|
name = "ghci_data",
|
|
|
|
define_values = {
|
|
|
|
"ghci_data": "True",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2020-04-24 13:08:32 +03:00
|
|
|
[
|
|
|
|
sh_binary(
|
|
|
|
name = "sandbox-with-postgres-{}".format(version),
|
|
|
|
srcs = ["@//bazel_tools:sandbox-with-postgres.sh"],
|
2020-06-19 16:55:39 +03:00
|
|
|
args = ["sandbox"],
|
2020-04-24 15:04:14 +03:00
|
|
|
data = [
|
2020-05-05 15:46:58 +03:00
|
|
|
"@//bazel_tools/client_server/with-postgres:with-postgres-exe",
|
2020-04-24 15:04:14 +03:00
|
|
|
"@daml-sdk-{}//:daml".format(version),
|
|
|
|
],
|
2020-04-24 13:08:32 +03:00
|
|
|
deps = ["@bazel_tools//tools/bash/runfiles"],
|
2020-04-24 15:04:14 +03:00
|
|
|
)
|
|
|
|
for version in platform_versions
|
2020-04-24 13:08:32 +03:00
|
|
|
]
|
|
|
|
|
2020-05-25 17:25:10 +03:00
|
|
|
[
|
|
|
|
[
|
|
|
|
create_daml_app_dar(sdk_version),
|
|
|
|
create_daml_app_codegen(sdk_version),
|
|
|
|
]
|
|
|
|
for sdk_version in sdk_versions
|
|
|
|
]
|
|
|
|
|
2020-04-23 15:46:22 +03:00
|
|
|
[
|
|
|
|
sdk_platform_test(
|
|
|
|
platform_version = platform_version,
|
2020-04-24 15:04:14 +03:00
|
|
|
sdk_version = sdk_version,
|
2020-04-23 15:46:22 +03:00
|
|
|
)
|
|
|
|
for sdk_version in sdk_versions
|
|
|
|
for platform_version in platform_versions
|
2020-04-28 17:06:36 +03:00
|
|
|
]
|
2020-04-24 15:43:35 +03:00
|
|
|
|
2020-05-05 13:33:32 +03:00
|
|
|
[
|
|
|
|
daml_script_dar(sdk_version)
|
|
|
|
for sdk_version in sdk_versions
|
|
|
|
]
|
|
|
|
|
|
|
|
[
|
|
|
|
daml_script_test(
|
|
|
|
compiler_version = sdk_version,
|
|
|
|
runner_version = platform_version,
|
|
|
|
)
|
|
|
|
for sdk_version in sdk_versions
|
|
|
|
for platform_version in platform_versions
|
|
|
|
# Test that the DAML script runner can run DARs built with an older SDK
|
|
|
|
# version. I.e. where the runner version is at least the SDK version or
|
2020-05-27 15:32:37 +03:00
|
|
|
# more recent.
|
|
|
|
if versions.is_at_least(sdk_version, platform_version)
|
|
|
|
]
|
|
|
|
|
|
|
|
[
|
|
|
|
daml_trigger_dar(sdk_version)
|
|
|
|
for sdk_version in sdk_versions
|
|
|
|
]
|
|
|
|
|
|
|
|
[
|
|
|
|
daml_trigger_test(
|
|
|
|
compiler_version = sdk_version,
|
|
|
|
runner_version = platform_version,
|
|
|
|
)
|
|
|
|
for sdk_version in sdk_versions
|
|
|
|
for platform_version in platform_versions
|
|
|
|
# Test that the DAML trigger runner can run DARs built with an older SDK
|
|
|
|
# version. I.e. where the runner version is at least the SDK version or
|
|
|
|
# more recent.
|
|
|
|
if versions.is_at_least(sdk_version, platform_version)
|
2020-05-05 13:33:32 +03:00
|
|
|
]
|
|
|
|
|
2020-05-05 15:46:58 +03:00
|
|
|
# We have two migration tests: migration-stable runs through all stable releases
|
|
|
|
# including current HEAD. migration-all includes snapshot releases.
|
|
|
|
|
|
|
|
migration_test(
|
|
|
|
name = "migration-stable",
|
2020-07-10 23:20:54 +03:00
|
|
|
timeout = "long",
|
2020-05-06 13:22:56 +03:00
|
|
|
# Exclusive due to hardcoded postgres ports.
|
|
|
|
tags = [
|
|
|
|
"exclusive",
|
|
|
|
"head-quick",
|
|
|
|
],
|
2020-05-05 20:40:03 +03:00
|
|
|
versions = stable_versions,
|
2020-05-05 15:46:58 +03:00
|
|
|
) if not is_windows else None
|
|
|
|
|
2020-06-12 15:29:27 +03:00
|
|
|
migration_test(
|
|
|
|
name = "meta-migration-test",
|
|
|
|
tags = [
|
|
|
|
"exclusive",
|
|
|
|
"manual",
|
|
|
|
],
|
|
|
|
versions = [
|
|
|
|
"1.0.0",
|
|
|
|
"0.0.0",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-05-05 15:46:58 +03:00
|
|
|
migration_test(
|
|
|
|
name = "migration-all",
|
2020-07-10 23:20:54 +03:00
|
|
|
timeout = "long",
|
2020-05-06 13:22:56 +03:00
|
|
|
# Exclusive due to hardcoded postgres ports.
|
|
|
|
tags = ["exclusive"],
|
2020-05-05 15:46:58 +03:00
|
|
|
versions = platform_versions,
|
|
|
|
) if not is_windows else None
|
2020-06-12 10:48:53 +03:00
|
|
|
|
|
|
|
[
|
|
|
|
data_dependencies_coins(
|
|
|
|
sdk_version = sdk_version,
|
|
|
|
)
|
|
|
|
for sdk_version in sdk_versions
|
|
|
|
]
|
|
|
|
|
|
|
|
[
|
2020-06-12 20:21:00 +03:00
|
|
|
data_dependencies_upgrade_test(
|
2020-06-12 10:48:53 +03:00
|
|
|
new_sdk_version = new_sdk_version,
|
|
|
|
old_sdk_version = old_sdk_version,
|
|
|
|
)
|
|
|
|
for old_sdk_version in sdk_versions
|
|
|
|
for new_sdk_version in sdk_versions
|
|
|
|
# Tests that we can build a package with a newer SDK version that has
|
|
|
|
# data-dependencies on packages built with an older SDK version.
|
|
|
|
if versions.is_at_least(old_sdk_version, new_sdk_version)
|
|
|
|
]
|