daml/ledger/ledger-api-test-tool-on-canton/BUILD.bazel
Gerolf Seitz a2d785e3ee
Use com.daml as root package (#5343)
Packages com.digitalasset.daml and com.daml have been unified under com.daml

Ledger API and DAML-LF DEV protos have also been moved from `com/digitalasset`
to `com/daml` on the file system.
Protos for already released DAML LF versions (1.6, 1.7, 1.8) stay in the
package `com.digitalasset`.

CHANGELOG_BEGIN
[SDK] All Java and Scala packages starting with
``com.digitalasset.daml`` and ``com.digitalasset`` are now consolidated
under ``com.daml``. Simply changing imports should be enough to
migrate your code.
CHANGELOG_END
2020-04-05 19:49:57 +02:00

77 lines
2.6 KiB
Python

# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("//ledger/ledger-api-test-tool:conformance.bzl", "conformance_test")
load("@os_info//:os_info.bzl", "is_windows")
java_binary(
name = "canton",
main_class = "com.daml.canton.CantonApp",
runtime_deps = ["@canton//:lib"],
)
# Disabled on Windows because `coreutils` and `grpcurl` aren't easily available.
genrule(
name = "canton-test-runner-with-dependencies-script",
srcs = [
":canton-test-runner.sh",
],
outs = ["canton-test-runner-with-dependencies.sh"],
cmd = """
cat > $@ <<EOF
#!/usr/bin/env bash
set -euo pipefail
f=bazel_tools/tools/bash/runfiles/runfiles.bash
source "\$${RUNFILES_DIR:-/dev/null}/\$$f" 2>/dev/null || \
source "\$$(grep -sm1 "^\$$f " "\$${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \
source "\$$0.runfiles/\$$f" 2>/dev/null || \
source "\$$(grep -sm1 "^\$$f " "\$$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
source "\$$(grep -sm1 "^\$$f " "\$$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
{ echo>&2 "ERROR: cannot find \$$f"; exit 1; }; f=; set -e
PATH="\$$(rlocation coreutils_nix/bin):\$$(rlocation curl_nix/bin):\$$(rlocation grpcurl_nix/bin):\$$(rlocation jq_dev_env/bin):\$$PATH"
export PATH
EOF
cat $< >> $@
""",
) if not is_windows else None
# Required because running `canton-test-runner-with-dependencies-script` directly fails.
sh_binary(
name = "canton-test-runner-with-dependencies",
srcs = [":canton-test-runner-with-dependencies-script"],
# Ideally these would be part of the script definition above, but that doesn't seem to work.
deps = ["@bazel_tools//tools/bash/runfiles"],
) if not is_windows else None
conformance_test(
name = "conformance-test",
# Ideally these would be part of the script definition above, but that doesn't seem to work.
extra_data = [
":bootstrap.canton",
":canton",
":canton.conf",
"@coreutils_nix//:bin/base64",
"@curl_nix//:bin/curl",
"@grpcurl_nix//:bin/grpcurl",
"@jq_dev_env//:jq",
],
ports = [
5011,
5021,
],
runner = "@//bazel_tools/client_server/runner:runner",
server = ":canton-test-runner-with-dependencies",
test_tool_args = [
"--verbose",
"--include=SemanticTests",
],
# temporarily disabling canton tests, because the api server
# in the canton release still requires old time model fields.
# Enable the tests again, once canton is upgraded.
) if False else None
#) if not is_windows else None