Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ledger API test tool: test against legacy and preview version. #8913

Merged
merged 5 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address Stefano's review
  • Loading branch information
remyhaemmerle-da committed Feb 22, 2021
commit 6c60af6ae5f2c1f55bf10f5c1cc845c8add5a0b2
8 changes: 4 additions & 4 deletions daml-lf/language/daml-lf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ lf_version_configuration = {

lf_version_configuration_versions = depset(lf_version_configuration.values()).to_list()

# aggregate a list of version keywords and version:
# - convert keyword in version
# - remove "preview" if no preview version is available.
# - remove duplicates
# aggregates a list of version keywords and versions:
# 1. converts keyword in version
# 2. removes "preview" if no preview version is available.
# 3. removes duplicates
def lf_versions_aggregate(versions):
lf_versions = [lf_version_configuration.get(version, version) for version in versions]
return depset([lf_version for lf_version in lf_versions if lf_version != "preview"]).to_list()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ object TestUtil {
testCode: Channel => Assertion
)(implicit resourceContext: ResourceContext): Future[Assertion] = {
val config = sandbox.DefaultConfig.copy(
// FIXME should work with seeding set.
//seeding = Some(com.daml.ledger.participant.state.v1.SeedService.Seeding.Weak),
seeding = None,
seeding = Some(com.daml.ledger.participant.state.v1.SeedService.Seeding.Weak),
port = Port.Dynamic,
damlPackages = List(testDalf),
ledgerIdMode = LedgerIdMode.Static(LedgerId(LedgerID)),
Expand Down
27 changes: 10 additions & 17 deletions ledger/daml-on-sql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
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
Expand Up @@ -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",
Expand Down Expand Up @@ -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: drop the following line once canton-test-runner supports 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: drop the following line once canton-test-runner supports 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
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
],
)
Loading