daml/ledger/ledger-api-test-tool/conformance.bzl
Gerolf Seitz d617922618
Remove InMemoryKVParticipantState (#4674)
This removes the sample/reference implementation of kvutils
InMemoryKVParticipantState.
This used to be the only implementation of kvutils, but now with the
simplified kvutils api we have ledger-on-memory and ledger-on-sql.

InMemoryKVParticipantState was also used for the ledger dump utility,
which now uses ledger-on-memory.

* Runner now supports a multi participant configuration
This change removes the "extra participants" config and goes for consistent
participant setup with --participant.

* Run all conformance tests in the repository in verbose mode.

This means we'll print stack traces on error, which should make it
easier to figure out what's going on with flaky tests on CI.

This doesn't change the default for other users of the
ledger-api-test-tool; we just add the flag for:

  - ledger-api-test-tool-on-canton
  - ledger-on-memory
  - ledger-on-sql
  - sandbox




Fixes #4225.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-26 15:45:35 +01:00

53 lines
1.7 KiB
Python

# Copyright (c) 2020 The DAML Authors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load(
"//bazel_tools/client_server:client_server_test.bzl",
"client_server_test",
)
load("@os_info//:os_info.bzl", "is_windows")
def conformance_test(
name,
server,
server_args = [],
extra_data = [],
ports = [6865],
test_tool_args = [],
tags = [],
runner = "@//bazel_tools/client_server/runner_with_port_check:runner",
flaky = False):
client_server_test(
name = name,
runner = runner,
runner_args = ["%s" % port for port in ports],
timeout = "long",
client = "//ledger/ledger-api-test-tool",
client_args = test_tool_args + ["localhost:%s" % port for port in ports],
data = extra_data + [
"//ledger/test-common:dar-files",
],
server = server,
server_args = server_args,
server_files = [
"$(rootpaths //ledger/test-common:dar-files)",
],
tags = [
"dont-run-on-darwin",
"exclusive",
] + tags,
flaky = flaky,
) if not is_windows else None
def server_conformance_test(name, servers, server_args = [], test_tool_args = [], flaky = False):
for server_name, server in servers.items():
test_name = "-".join([segment for segment in [name, server_name] if segment])
conformance_test(
name = test_name,
extra_data = server.get("extra_data", []),
server = server["binary"],
server_args = server.get("server_args", []) + server_args,
test_tool_args = server.get("test_tool_args", []) + test_tool_args,
flaky = flaky,
)