mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
61d181d22c
* 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>
118 lines
3.1 KiB
Python
118 lines
3.1 KiB
Python
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
load("@os_info//:os_info.bzl", "is_windows")
|
|
load("//bazel_tools:testing.bzl", "create_daml_app_codegen", "create_daml_app_dar", "sdk_platform_test")
|
|
load(
|
|
"//bazel_tools/daml_script:daml_script.bzl",
|
|
"daml_script_dar",
|
|
"daml_script_test",
|
|
)
|
|
load(
|
|
"//bazel_tools/daml_trigger:daml_trigger.bzl",
|
|
"daml_trigger_dar",
|
|
"daml_trigger_test",
|
|
)
|
|
load("//bazel_tools:versions.bzl", "versions")
|
|
load("//sandbox-migration:util.bzl", "migration_test")
|
|
load("//:versions.bzl", "platform_versions", "sdk_versions", "stable_versions")
|
|
load("@daml//bazel_tools:haskell.bzl", "da_haskell_binary")
|
|
|
|
config_setting(
|
|
name = "ghci_data",
|
|
define_values = {
|
|
"ghci_data": "True",
|
|
},
|
|
)
|
|
|
|
[
|
|
sh_binary(
|
|
name = "sandbox-with-postgres-{}".format(version),
|
|
srcs = ["@//bazel_tools:sandbox-with-postgres.sh"],
|
|
data = [
|
|
"@//bazel_tools/client_server/with-postgres:with-postgres-exe",
|
|
"@daml-sdk-{}//:daml".format(version),
|
|
],
|
|
deps = ["@bazel_tools//tools/bash/runfiles"],
|
|
)
|
|
for version in platform_versions
|
|
]
|
|
|
|
[
|
|
[
|
|
create_daml_app_dar(sdk_version),
|
|
create_daml_app_codegen(sdk_version),
|
|
]
|
|
for sdk_version in sdk_versions
|
|
]
|
|
|
|
[
|
|
sdk_platform_test(
|
|
platform_version = platform_version,
|
|
sdk_version = sdk_version,
|
|
)
|
|
for sdk_version in sdk_versions
|
|
for platform_version in platform_versions
|
|
]
|
|
|
|
[
|
|
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
|
|
# 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)
|
|
]
|
|
|
|
test_suite(
|
|
name = "head-quick",
|
|
tags = ["head-quick"],
|
|
)
|
|
|
|
# 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",
|
|
# Exclusive due to hardcoded postgres ports.
|
|
tags = [
|
|
"exclusive",
|
|
"head-quick",
|
|
],
|
|
versions = stable_versions,
|
|
) if not is_windows else None
|
|
|
|
migration_test(
|
|
name = "migration-all",
|
|
# Exclusive due to hardcoded postgres ports.
|
|
tags = ["exclusive"],
|
|
versions = platform_versions,
|
|
) if not is_windows else None
|