Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address Stefano's review
Browse files Browse the repository at this point in the history
remyhaemmerle-da committed Feb 22, 2021
1 parent b591712 commit c1138b6
Showing 8 changed files with 177 additions and 212 deletions.
27 changes: 10 additions & 17 deletions ledger/daml-on-sql/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -100,26 +100,19 @@ da_scala_test(
],
)

[
conformance_test(
name = "conformance-test-%s" % lf_version,
client = "//ledger/ledger-api-test-tool:ledger-api-test-tool-%s" % lf_version,
server = ":daml-on-sql-ephemeral-postgresql",
server_args = [
"--ledgerid=conformance-test",
"--port=6865",
"--eager-package-loading",
],
)
for lf_version in lf_versions_aggregate([
"stable",
"latest",
"preview",
])
]
conformance_test(
name = "conformance-test",
server = ":daml-on-sql-ephemeral-postgresql",
server_args = [
"--ledgerid=conformance-test",
"--port=6865",
"--eager-package-loading",
],
)

conformance_test(
name = "conformance-test-multi-party-submissions",
lf_versions = ["stable"],
server = ":daml-on-sql-ephemeral-postgresql",
server_args = [
"--ledgerid=conformance-test",
211 changes: 97 additions & 114 deletions ledger/ledger-api-test-tool-on-canton/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@

load("//ledger/ledger-api-test-tool:conformance.bzl", "conformance_test")
load("@os_info//:os_info.bzl", "is_windows")
load("//daml-lf/language:daml-lf.bzl", "lf_versions_aggregate")

java_binary(
name = "canton",
@@ -48,117 +47,101 @@ sh_binary(
deps = ["@bazel_tools//tools/bash/runfiles"],
) if not is_windows else None

[
conformance_test(
name = "conformance-test-%s" % lf_version,
client = "//ledger/ledger-api-test-tool:ledger-api-test-tool-%s" % lf_version,
# Ideally these would be part of the script definition above, but that doesn't seem to work.
extra_data = [
":bootstrap.canton",
":canton",
":canton.conf",
":logback-debug.xml",
"@coreutils_nix//:bin/base64",
"@curl_nix//:bin/curl",
"@grpcurl_nix//:bin/grpcurl",
"@jq_dev_env//:jq",
],
ports = [
5011,
5021,
5031,
5041,
],
runner = "@//bazel_tools/client_server/runner:runner",
server = ":canton-test-runner-with-dependencies",
test_tool_args = [
"--verbose",
"--concurrent-test-runs=4", # lowered from default #procs to reduce flakes - details in https://github.com/digital-asset/daml/issues/7316
# The following three contract key tests require uniqueness and are tested in conformance-test-contract-keys below
"--exclude=ContractKeysIT,ContractKeysIT:CKFetchOrLookup,ContractKeysIT:CKNoFetchUndisclosed,ContractKeysIT:CKMaintainerScoped" +
",ParticipantPruningIT" + # see "conformance-test-participant-pruning" below
",ConfigManagementServiceIT,LedgerConfigurationServiceIT" + # dynamic config management not supported by Canton
",ClosedWorldIT" + # Canton currently fails this test with a different error (missing namespace in "unallocated" party id)
# The following tests fail because Canton raises a different error (see https://github.com/digital-asset/daml/pull/8642)
",PartyManagementServiceIT:PMRejectLongPartyHints,PartyManagementServiceIT:PMRejectInvalidPartyHints",
],
)
for lf_version in lf_versions_aggregate([
# TODO: uncomment the following line and drop the "legacy" as soon canton-test-runner support LF 1.11 and newers
# "stable", "latest", "preview",
"legacy",
])
if not is_windows
]
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",
":logback-debug.xml",
"@coreutils_nix//:bin/base64",
"@curl_nix//:bin/curl",
"@grpcurl_nix//:bin/grpcurl",
"@jq_dev_env//:jq",
],
ports = [
5011,
5021,
5031,
5041,
],
runner = "@//bazel_tools/client_server/runner:runner",
server = ":canton-test-runner-with-dependencies",
test_tool_args = [
"--verbose",
"--concurrent-test-runs=4", # lowered from default #procs to reduce flakes - details in https://github.com/digital-asset/daml/issues/7316
# The following three contract key tests require uniqueness and are tested in conformance-test-contract-keys below
"--exclude=ContractKeysIT,ContractKeysIT:CKFetchOrLookup,ContractKeysIT:CKNoFetchUndisclosed,ContractKeysIT:CKMaintainerScoped" +
",ParticipantPruningIT" + # see "conformance-test-participant-pruning" below
",ConfigManagementServiceIT,LedgerConfigurationServiceIT" + # dynamic config management not supported by Canton
",ClosedWorldIT" + # Canton currently fails this test with a different error (missing namespace in "unallocated" party id)
# The following tests fail because Canton raises a different error (see https://github.com/digital-asset/daml/pull/8642)
",PartyManagementServiceIT:PMRejectLongPartyHints,PartyManagementServiceIT:PMRejectInvalidPartyHints",
],
) if not is_windows else None

[
[
conformance_test(
name = "conformance-test-contract-keys-%s" % lf_version,
client = "//ledger/ledger-api-test-tool:ledger-api-test-tool-%s" % lf_version,
# Ideally these would be part of the script definition above, but that doesn't seem to work.
extra_data = [
":bootstrap.canton",
":canton",
":canton.conf",
":unique-contract-keys.conf", # needed to pass all contract keys conformance tests
":logback-debug.xml",
"@coreutils_nix//:bin/base64",
"@curl_nix//:bin/curl",
"@grpcurl_nix//:bin/grpcurl",
"@jq_dev_env//:jq",
],
ports = [
5011,
5021,
5031,
5041,
],
runner = "@//bazel_tools/client_server/runner:runner",
server = ":canton-test-runner-with-dependencies",
test_tool_args = [
"--verbose",
"--concurrent-test-runs=4", # lowered from default #procs to reduce flakes - details in https://github.com/digital-asset/daml/issues/7316
"--include=ContractKeysIT",
],
),
conformance_test(
name = "conformance-test-participant-pruning-%s" % lf_version,
client = "//ledger/ledger-api-test-tool:ledger-api-test-tool-%s" % lf_version,
# Ideally these would be part of the script definition above, but that doesn't seem to work.
extra_data = [
":bootstrap.canton",
":canton",
":canton.conf",
":enable-faster-pruning.conf", # needed to prevent timing out on prune requests
":logback-debug.xml",
"@coreutils_nix//:bin/base64",
"@curl_nix//:bin/curl",
"@grpcurl_nix//:bin/grpcurl",
"@jq_dev_env//:jq",
],
ports = [
5011,
5021,
5031,
5041,
],
runner = "@//bazel_tools/client_server/runner:runner",
server = ":canton-test-runner-with-dependencies",
tags = [
"manual", # pruning test is flaky on canton because of safe-pruning offset reconciliation checks
],
test_tool_args = [
"--verbose",
"--include=ParticipantPruningIT",
"--exclude=ParticipantPruningIT:PRFailPruneByOutOfBoundsOffset", # on behalf of bug not yet fixed in canton 0.19.0
],
),
]
for lf_version in lf_versions_aggregate([
# TODO: uncomment the following line and drop the "legacy" as soon canton-test-runner support LF 1.11 and newers
# "stable"
"legacy",
])
if not is_windows
]
conformance_test(
name = "conformance-test-contract-keys",
# Ideally these would be part of the script definition above, but that doesn't seem to work.
extra_data = [
":bootstrap.canton",
":canton",
":canton.conf",
":unique-contract-keys.conf", # needed to pass all contract keys conformance tests
":logback-debug.xml",
"@coreutils_nix//:bin/base64",
"@curl_nix//:bin/curl",
"@grpcurl_nix//:bin/grpcurl",
"@jq_dev_env//:jq",
],
# FIXME: uncomment the following line once canton-test-runner support LF 1.11 or newer
lf_versions = ["legacy"],
ports = [
5011,
5021,
5031,
5041,
],
runner = "@//bazel_tools/client_server/runner:runner",
server = ":canton-test-runner-with-dependencies",
test_tool_args = [
"--verbose",
"--concurrent-test-runs=4", # lowered from default #procs to reduce flakes - details in https://github.com/digital-asset/daml/issues/7316
"--include=ContractKeysIT",
],
) if not is_windows else None

conformance_test(
name = "conformance-test-participant-pruning",
# Ideally these would be part of the script definition above, but that doesn't seem to work.
extra_data = [
":bootstrap.canton",
":canton",
":canton.conf",
":enable-faster-pruning.conf", # needed to prevent timing out on prune requests
":logback-debug.xml",
"@coreutils_nix//:bin/base64",
"@curl_nix//:bin/curl",
"@grpcurl_nix//:bin/grpcurl",
"@jq_dev_env//:jq",
],
# FIXME: uncomment the following line once canton-test-runner support LF 1.11 or newer
lf_versions = ["legacy"],
ports = [
5011,
5021,
5031,
5041,
],
runner = "@//bazel_tools/client_server/runner:runner",
server = ":canton-test-runner-with-dependencies",
tags = [
"manual", # pruning test is flaky on canton because of safe-pruning offset reconciliation checks
],
test_tool_args = [
"--verbose",
"--include=ParticipantPruningIT",
"--exclude=ParticipantPruningIT:PRFailPruneByOutOfBoundsOffset", # on behalf of bug not yet fixed in canton 0.19.0
],
) if not is_windows else None
35 changes: 17 additions & 18 deletions ledger/ledger-api-test-tool/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -198,6 +198,7 @@ conformance_test(
"//ledger/test-common/test-certificates:server.pem",
"//ledger/test-common/test-certificates:ca.crt",
],
lf_versions = ["stable"],
server = "//ledger/ledger-on-memory:app",
server_args = [
"--contract-id-seeding=testing-weak",
@@ -219,6 +220,7 @@ conformance_test(
# Retired tests will be eventually removed
conformance_test(
name = "retired-tests",
lf_versions = ["stable"],
server = "//ledger/ledger-on-memory:app",
server_args = [
"--contract-id-seeding=testing-weak",
@@ -236,6 +238,7 @@ conformance_test(
# Deprecated CLI options will be eventually removed
conformance_test(
name = "deprecated-cli-options",
lf_versions = ["stable"],
server = "//ledger/ledger-on-memory:app",
server_args = [
"--contract-id-seeding=testing-weak",
@@ -253,6 +256,7 @@ conformance_test(
# are supported.
conformance_test(
name = "test-name-syntax",
lf_versions = ["stable"],
server = "//ledger/ledger-on-memory:app",
server_args = [
"--contract-id-seeding=testing-weak",
@@ -265,21 +269,16 @@ conformance_test(
)

# Test that runs the whole ledger API test suite once for each listed compiler version
[
[
conformance_test(
name = "conformance-test-lf-version-%s" % lf_version,
client = "//ledger/ledger-api-test-tool:ledger-api-test-tool-%s" % lf_version,
server = "//ledger/ledger-on-memory:app",
server_args = [
"--daml-lf-dev-mode-unsafe", # Enables the use of all known compiler versions
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test-dev-mode,port=6865",
],
test_tool_args = [
"--verbose",
],
),
]
for lf_version in lf_version_configuration_versions
]
conformance_test(
name = "conformance-test-lf-version",
lf_versions = lf_version_configuration_versions,
server = "//ledger/ledger-on-memory:app",
server_args = [
"--daml-lf-dev-mode-unsafe", # Enables the use of all known compiler versions
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test-dev-mode,port=6865",
],
test_tool_args = [
"--verbose",
],
)
57 changes: 29 additions & 28 deletions ledger/ledger-api-test-tool/conformance.bzl
Original file line number Diff line number Diff line change
@@ -17,35 +17,36 @@ def conformance_test(
ports = [6865],
test_tool_args = [],
tags = [],
client = "//ledger/ledger-api-test-tool",
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 = client,
client_args = test_tool_args + ["localhost:%s" % port for port in ports],
data = extra_data,
server = server,
server_args = server_args,
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, lf_versions = ["stable", "latest", "preview"]):
flaky = False,
lf_versions = ["stable", "latest", "preview"]):
for lf_version in lf_versions_aggregate(lf_versions):
for server_name, server in servers.items():
test_name = "-".join([segment for segment in [name, lf_version, 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,
if not is_windows:
client_server_test(
name = "-".join([name, lf_version]),
runner = runner,
runner_args = ["%s" % port for port in ports],
timeout = "long",
client = "//ledger/ledger-api-test-tool:ledger-api-test-tool-%s" % lf_version,
client_args = test_tool_args + ["localhost:%s" % port for port in ports],
data = extra_data,
server = server,
server_args = server_args,
tags = [
"dont-run-on-darwin",
"exclusive",
] + tags,
flaky = flaky,
)

def server_conformance_test(name, servers, server_args = [], test_tool_args = [], flaky = False, lf_versions = ["stable", "latest", "preview"]):
for server_name, server in servers.items():
test_name = "-".join([name, server_name])
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,
)
Loading
Oops, something went wrong.

0 comments on commit c1138b6

Please sign in to comment.