Skip to content

Commit

Permalink
fix preview test
Browse files Browse the repository at this point in the history
  • Loading branch information
remyhaemmerle-da committed Feb 22, 2021
1 parent 73a0bfa commit 0b31935
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 34 deletions.
1 change: 1 addition & 0 deletions daml-lf/language/daml-lf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# we bump stable.
# The following dictionary is always defined for "legacy", "stable", "latest",
# and "dev". It contains "preview" iff a preview version is available.
# If exists "preview"'s value is guarantee to be different for all other values.
lf_version_configuration = {
"legacy": "1.8",
"stable": "1.8",
Expand Down
1 change: 0 additions & 1 deletion ledger/daml-on-sql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ conformance_test(

conformance_test(
name = "conformance-test-multi-party-submissions",
lf_versions = ["stable"],
server = ":daml-on-sql-ephemeral-postgresql",
server_args = [
"--ledgerid=conformance-test",
Expand Down
5 changes: 4 additions & 1 deletion ledger/ledger-api-test-tool-on-canton/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ sh_binary(

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",
Expand All @@ -60,6 +59,10 @@ conformance_test(
"@grpcurl_nix//:bin/grpcurl",
"@jq_dev_env//:jq",
],
# Ideally these would be part of the script definition above, but that doesn't seem to work.
# FIXME: drop the following line once canton-test-runner supports LF 1.11 or newer
lf_versions = ["legacy"],
# lf_versions = ["stable", "latest"]
ports = [
5011,
5021,
Expand Down
17 changes: 5 additions & 12 deletions ledger/ledger-api-test-tool/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ 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 @@ -215,7 +214,6 @@ 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 @@ -233,7 +231,6 @@ 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 @@ -251,7 +248,6 @@ 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 @@ -263,17 +259,14 @@ conformance_test(
],
)

# Test that runs the whole ledger API test suite once for each listed compiler version
conformance_test(
name = "conformance-test-lf-version",
name = "conformance-test",
lf_versions = lf_version_configuration_versions,
server = "//ledger/ledger-on-memory:app",
ports = [6865],
server = ":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",
"--participant=participant-id=example,port=6865",
],
test_tool_args = ["--verbose"],
)
9 changes: 5 additions & 4 deletions ledger/ledger-api-test-tool/conformance.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load(
)
load("@os_info//:os_info.bzl", "is_windows")
load("@scala_version//:index.bzl", "scala_major_version")
load("//daml-lf/language:daml-lf.bzl", "lf_versions_aggregate")
load("//daml-lf/language:daml-lf.bzl", "lf_version_configuration", "lf_versions_aggregate")

def conformance_test(
name,
Expand All @@ -18,9 +18,10 @@ def conformance_test(
test_tool_args = [],
tags = [],
runner = "@//bazel_tools/client_server/runner_with_port_check:runner",
lf_versions = ["stable", "latest", "preview"],
lf_versions = ["stable"],
flaky = False):
for lf_version in lf_versions_aggregate(lf_versions):
extra_server_args = ["--daml-lf-dev-mode-unsafe"] if lf_version == lf_version_configuration.get("preview") or lf_version == lf_version_configuration.get("dev") else []
if not is_windows:
client_server_test(
name = "-".join([name, lf_version]),
Expand All @@ -31,15 +32,15 @@ def conformance_test(
client_args = test_tool_args + ["localhost:%s" % port for port in ports],
data = extra_data,
server = server,
server_args = server_args,
server_args = server_args + extra_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"]):
def server_conformance_test(name, servers, server_args = [], test_tool_args = [], flaky = False, lf_versions = ["stable"]):
for server_name, server in servers.items():
test_name = "-".join([name, server_name])
conformance_test(
Expand Down
12 changes: 4 additions & 8 deletions ledger/ledger-on-memory/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ load(
"da_scala_library",
"da_scala_test_suite",
)
load(
"//daml-lf/language:daml-lf.bzl",
"lf_version_configuration_versions",
)
load("//ledger/ledger-api-test-tool:conformance.bzl", "conformance_test")
load("@os_info//:os_info.bzl", "is_windows")

Expand Down Expand Up @@ -136,14 +140,10 @@ conformance_test(
"--contract-id-seeding=testing-weak",
"--participant=participant-id=example,port=6865",
],
test_tool_args = [
"--verbose",
],
)

conformance_test(
name = "conformance-test-multi-participant",
lf_versions = ["stable"],
ports = [
6865,
6866,
Expand All @@ -162,7 +162,6 @@ conformance_test(

conformance_test(
name = "conformance-test-split-participant",
lf_versions = ["stable"],
ports = [
6865,
],
Expand All @@ -180,7 +179,6 @@ conformance_test(

conformance_test(
name = "conformance-test-participant-pruning",
lf_versions = ["stable"],
ports = [6865],
server = ":app",
server_args = [
Expand All @@ -195,7 +193,6 @@ conformance_test(

conformance_test(
name = "conformance-test-multi-party-submission",
lf_versions = ["stable"],
ports = [6865],
server = ":app",
server_args = [
Expand All @@ -210,7 +207,6 @@ conformance_test(

conformance_test(
name = "benchmark-performance-envelope",
lf_versions = ["stable"],
ports = [6865],
server = ":app",
server_args = [
Expand Down
9 changes: 5 additions & 4 deletions ledger/ledger-on-sql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ da_scala_test_suite(
[
conformance_test(
name = "conformance-test-{}".format(db["name"]),
lf_versions = ["stable"],
lf_versions = [
"stable",
"latest",
"preview",
],
ports = [6865],
server = ":conformance-test-{}-bin".format(db["name"]),
server_args = [
Expand Down Expand Up @@ -275,7 +279,6 @@ da_scala_test_suite(
),
conformance_test(
name = "conformance-test-participant-pruning-{}".format(db["name"]),
lf_versions = ["stable"],
ports = [6865],
server = ":conformance-test-{}-bin".format(db["name"]),
server_args = [
Expand All @@ -290,7 +293,6 @@ da_scala_test_suite(
),
conformance_test(
name = "conformance-test-multi-party-submission-{}".format(db["name"]),
lf_versions = ["stable"],
ports = [6865],
server = ":conformance-test-{}-bin".format(db["name"]),
server_args = [
Expand All @@ -305,7 +307,6 @@ da_scala_test_suite(
),
conformance_test(
name = "benchmark-performance-envelope-{}".format(db["name"]),
lf_versions = ["stable"],
ports = [6865],
server = ":conformance-test-{}-bin".format(db["name"]),
server_args = [
Expand Down
8 changes: 6 additions & 2 deletions ledger/sandbox-classic/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,11 @@ SERVERS = {

server_conformance_test(
name = "conformance-test-static-time",
lf_versions = ["stable"],
lf_versions = [
"stable",
"stable",
"preview",
],
server_args = [
"--static-time",
"--contract-id-seeding=testing-weak",
Expand All @@ -296,7 +300,7 @@ server_conformance_test(
)

server_conformance_test(
name = "conformance-test",
name = "conformance-test-wall-clock",
server_args = [
"--wall-clock-time",
"--contract-id-seeding=testing-weak",
Expand Down
7 changes: 5 additions & 2 deletions ledger/sandbox/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ NEXT_SERVERS = {

server_conformance_test(
name = "next-conformance-test-static-time",
lf_versions = [
"stable",
"latest",
"preview",
],
server_args = [
"--static-time",
],
Expand All @@ -256,7 +261,6 @@ server_conformance_test(

server_conformance_test(
name = "next-conformance-test-wall-clock",
lf_versions = ["stable"],
server_args = [
"--wall-clock-time",
],
Expand All @@ -269,7 +273,6 @@ server_conformance_test(

server_conformance_test(
name = "next-conformance-test-closed-world",
lf_versions = ["stable"],
server_args = [
"--wall-clock-time",
"--implicit-party-allocation=false",
Expand Down

0 comments on commit 0b31935

Please sign in to comment.