daml/triggers/tests/BUILD.bazel
Moritz Kiefer 7a2e12d6d2
[daml-triggers] Expose template data in CreateEvents (#2973)
Now that we have AnyTemplate, we can actually make the template data accessible.
2019-09-23 12:49:01 +02:00

74 lines
2.0 KiB
Python

# Copyright (c) 2019 The DAML Authors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load(
"//bazel_tools:scala.bzl",
"da_scala_binary",
)
load(
"//bazel_tools/client_server_test:client_server_test.bzl",
"client_server_test",
)
genrule(
name = "acs",
srcs =
glob(["**/*.daml"]) + [
"//triggers/daml:trigger.dar",
],
outs = ["acs.dar"],
cmd = """
set -eou pipefail
TMP_DIR=$$(mktemp -d)
mkdir -p $$TMP_DIR/daml
cp -L $(location :daml/ACS.daml) $$TMP_DIR/daml
cp -L $(location //triggers/daml:trigger.dar) $$TMP_DIR/
cat << EOF > $$TMP_DIR/daml.yaml
sdk-version: 0.0.0
name: acs
source: daml
version: 0.0.1
dependencies:
- daml-stdlib
- daml-prim
- trigger.dar
EOF
$(location //compiler/damlc) build --target=1.dev --project-root=$$TMP_DIR -o $$PWD/$(location acs.dar)
rm -rf $$TMP_DIR
""",
tools = ["//compiler/damlc"],
visibility = ["//visibility:public"],
)
da_scala_binary(
name = "acs_test_client",
srcs = glob(["src/**/*.scala"]),
main_class = "com.daml.trigger.test.AcsMain",
deps = [
"//3rdparty/jvm/com/github/scopt",
"//3rdparty/jvm/com/typesafe/akka:akka_stream",
"//3rdparty/jvm/org/scalaz:scalaz_core",
"//daml-lf/archive:daml_lf_archive_scala",
"//daml-lf/archive:daml_lf_java_proto",
"//daml-lf/data",
"//daml-lf/interpreter",
"//daml-lf/language",
"//daml-lf/transaction",
"//language-support/scala/bindings",
"//language-support/scala/bindings-akka",
"//ledger-api/rs-grpc-bridge",
"//triggers/runner:trigger-runner-lib",
],
)
client_server_test(
name = "acs_test",
client = ":acs_test_client",
client_files = ["$(rootpath :acs.dar)"],
data = [":acs.dar"],
# See https://github.com/digital-asset/daml/issues/2881
flaky = True,
server = "//ledger/sandbox:sandbox-binary",
server_files = ["$(rootpath :acs.dar)"],
)