daml/ledger/ledger-api-test-tool/BUILD.bazel
2019-08-13 17:23:03 +01:00

126 lines
4.8 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",
"da_scala_library",
"da_scala_test_suite",
)
load(
"//bazel_tools/client_server_test:client_server_test.bzl",
"client_server_test",
)
load("@os_info//:os_info.bzl", "is_windows")
da_scala_binary(
name = "ledger-api-test-tool",
srcs = glob([
"src/main/scala/com/daml/ledger/api/testtool/**/*.scala",
]),
main_class = "com.daml.ledger.api.testtool.LedgerApiTestTool",
resources = [
"src/main/resources/logback.xml",
"//ledger/test-common:SemanticTests.dar",
"//ledger/test-common:Test.dar",
],
tags = [
"maven_coordinates=com.daml.ledger.testtool:ledger-api-test-tool:__VERSION__",
# We release this as a fat jar so this tag ensures that the dependencies in the generated
# POM file are set correctly.
"fat_jar",
],
visibility = ["//visibility:public"],
deps = [
"//3rdparty/jvm/ch/qos/logback:logback_classic",
"//3rdparty/jvm/com/github/scopt",
"//3rdparty/jvm/io/grpc:grpc_netty",
"//3rdparty/jvm/io/netty:netty_tcnative_boringssl_static",
"//3rdparty/jvm/org/slf4j:slf4j_api",
"//daml-lf/archive:daml_lf_archive_scala",
"//daml-lf/archive:daml_lf_java_proto",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/interpreter",
"//daml-lf/language",
"//daml-lf/testing-tools",
"//daml-lf/transaction",
"//language-support/scala/bindings",
"//ledger/ledger-api-common",
"//ledger/ledger-api-domain",
"//ledger/test-common",
"//ledger/test-common:Test.scala",
"//ledger/test-common:Test-1.6.scala",
],
)
client_server_test(
name = "ledger-api-test-tool-test",
timeout = "short",
client = ":ledger-api-test-tool",
client_args = [
# NOTE(GP): our CI has a tendency to be more unpredictable than local
# machine with timeouts, we value lack of flakes on CI.
"--timeout-scale-factor=10",
],
# Data files available to both client and server.
data = [
"//ledger/test-common:SemanticTests.dar",
"//ledger/test-common:Test.dar",
"//ledger/test-common:Test-1.6.dar",
"@postgresql_dev_env//:all",
"@postgresql_dev_env//:createdb",
"@postgresql_dev_env//:initdb",
"@postgresql_dev_env//:pg_ctl",
],
server = "//ledger/api-server-damlonx/reference-v2:ephemeral-postgres-reference-server",
server_args = [
"$(rlocation $TEST_WORKSPACE/$(rootpath //ledger/test-common:SemanticTests.dar))",
"$(rlocation $TEST_WORKSPACE/$(rootpath //ledger/test-common:Test.dar))",
"$(rlocation $TEST_WORKSPACE/$(rootpath //ledger/test-common:Test-1.6.dar))",
],
tags = [
# NOTE(JM,GP): As this test is somewhat heavy and has timeouts, run it
# without competition to avoid flakiness.
"exclusive",
],
) if not is_windows else None
client_server_test(
name = "ledger-api-test-tool-ssltest",
timeout = "short",
client = ":ledger-api-test-tool",
client_args = [
"--crt $(rlocation $TEST_WORKSPACE/$(rootpath test/main/resources/client.crt))",
"--cacrt $(rlocation $TEST_WORKSPACE/$(rootpath test/main/resources/ca.crt))",
"--pem $(rlocation $TEST_WORKSPACE/$(rootpath test/main/resources/client.pem))",
# NOTE(GP): our CI has a tendency to be more unpredictable than local
# machine with timeouts, we value lack of flakes on CI.
"--timeout-scale-factor=10",
],
# Data files available to both client and server.
data = [
"//ledger/test-common:SemanticTests.dar",
"//ledger/test-common:Test.dar",
"//ledger/test-common:Test-1.6.dar",
"@postgresql_dev_env//:all",
"@postgresql_dev_env//:createdb",
"@postgresql_dev_env//:initdb",
"@postgresql_dev_env//:pg_ctl",
] + glob(["test/main/resources/*"]),
server = "//ledger/api-server-damlonx/reference-v2:ephemeral-postgres-reference-server",
server_args = [
"$(rlocation $TEST_WORKSPACE/$(rootpath //ledger/test-common:SemanticTests.dar))",
"$(rlocation $TEST_WORKSPACE/$(rootpath //ledger/test-common:Test.dar))",
"$(rlocation $TEST_WORKSPACE/$(rootpath //ledger/test-common:Test-1.6.dar))",
"--crt $(rlocation $TEST_WORKSPACE/$(rootpath test/main/resources/server.crt))",
"--cacrt $(rlocation $TEST_WORKSPACE/$(rootpath test/main/resources/ca.crt))",
"--pem $(rlocation $TEST_WORKSPACE/$(rootpath test/main/resources/server.pem))",
],
tags = [
# NOTE(JM,GP): As this test is somewhat heavy and has timeouts, run it
# without competition to avoid flakiness.
"exclusive",
],
) if not is_windows else None