daml/ledger/sandbox-on-x/BUILD.bazel
Samir Talwar 9c77a3c94b
kvutils: Remove the DAR upload parameters from the runner. (#12366)
* kvutils: Remove the DAR upload parameters from the runner.

No production ledger needs to upload DARs on participant startup; this
feature is primarily for users of Sandbox. The feature never worked in
the case of multiple participants and was only ever used in testing.

This also removes the associated functionality from Sandbox-on-X as they
share a configuration object. Hopefully this won't be an issue.

Some tests were using this feature, so I have updated them to upload the
DARs through the PackageManagementService instead.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Remove the `writePackagesService` factory constructor.

We no longer use it.

* daml-lf/engine: Revert an unnecessary change.

* daml-script/test: Shut down the channel after uploading the DAR.
2022-01-12 12:57:02 +01:00

216 lines
7.0 KiB
Python

# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. 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("//ledger/ledger-api-test-tool:conformance.bzl", "conformance_test")
load("@os_info//:os_info.bzl", "is_windows")
da_scala_library(
name = "sandbox-on-x",
srcs = glob(["src/main/scala/**/*.scala"]),
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
"@maven//:com_github_scopt_scopt",
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
],
tags = ["maven_coordinates=com.daml:sandbox-on-x:__VERSION__"],
visibility = [
"//visibility:public",
],
deps = [
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/language",
"//daml-lf/transaction",
"//language-support/scala/bindings",
"//ledger/caching",
"//ledger/error",
"//ledger/ledger-api-auth",
"//ledger/ledger-api-common",
"//ledger/ledger-api-domain",
"//ledger/ledger-api-health",
"//ledger/ledger-configuration",
"//ledger/ledger-offset",
"//ledger/ledger-resources",
"//ledger/metrics",
"//ledger/participant-integration-api",
"//ledger/participant-state",
"//ledger/participant-state-index",
"//ledger/participant-state-metrics",
"//ledger/participant-state/kvutils",
"//ledger/participant-state/kvutils/app",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/logging-entries",
"//libs-scala/resources",
"//libs-scala/resources-akka",
"//libs-scala/resources-grpc",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:io_dropwizard_metrics_metrics_core",
],
)
da_scala_test_suite(
name = "sandbox-on-x-tests",
size = "small",
srcs = glob(
["src/test/suite/**/*.scala"],
),
data = [],
jvm_flags = [],
plugins = [],
resources = glob(["src/test/resources/**/*"]),
scala_deps = [
"@maven//:org_mockito_mockito_scala",
],
deps = [
":sandbox-on-x",
"//daml-lf/data",
"//daml-lf/transaction",
"//daml-lf/transaction-test-lib",
"//language-support/scala/bindings",
"//ledger/error",
"//ledger/ledger-api-common",
"//ledger/ledger-api-domain",
"//ledger/ledger-api-health",
"//ledger/ledger-configuration",
"//ledger/ledger-offset",
"//ledger/metrics",
"//ledger/participant-integration-api",
"//ledger/participant-state",
"//ledger/participant-state-index",
"//ledger/participant-state-metrics",
"//libs-scala/contextualized-logging",
"//libs-scala/logging-entries",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:org_mockito_mockito_core",
],
)
da_scala_library(
name = "sandbox-on-x-app",
srcs = glob(["src/app/scala/**/*.scala"]),
resources = glob(["src/app/resources/**/*"]),
scala_deps = [
],
tags = ["maven_coordinates=com.daml:sandbox-on-x-app:__VERSION__"],
visibility = ["//visibility:public"],
deps = [
":sandbox-on-x",
"//ledger/ledger-resources",
"//libs-scala/contextualized-logging",
"//libs-scala/resources",
],
)
da_scala_binary(
name = "app",
main_class = "com.daml.ledger.sandbox.Main",
visibility = ["//visibility:public"],
runtime_deps = [
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:com_h2database_h2",
],
deps = [
":sandbox-on-x-app",
],
)
conformance_test(
name = "conformance-test",
ports = [6865],
server = ":app",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=example,port=6865",
"--mutable-contract-state-cache",
],
test_tool_args = [
"--verbose",
"--additional=ParticipantPruningIT",
"--additional=MultiPartySubmissionIT",
"--exclude=ClosedWorldIT",
"--exclude=ContractKeysIT",
"--exclude=SemanticTests",
"--exclude=RaceConditionIT",
"--exclude=ExceptionRaceConditionIT",
"--exclude=ExceptionsIT:ExRollbackDuplicateKeyCreated",
"--exclude=ExceptionsIT:ExRollbackDuplicateKeyArchived",
"--exclude=ConfigManagementServiceIT:CMConcurrentSetConflicting",
# Disable tests targeting only append-only schema functionality
"--exclude=ParticipantPruningIT:PRLocalAndNonLocalRetroactiveDivulgences,ParticipantPruningIT:PRRetroactiveDivulgences,ParticipantPruningIT:PRImmediateAndRetroactiveDivulgence",
],
)
conformance_test(
name = "conformance-test-conflict-checking",
ports = [6865],
server = ":app",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=example,port=6865",
"--mutable-contract-state-cache",
"--enable-conflict-checking",
],
test_tool_args = [
"--verbose",
"--additional=CommandDeduplicationParallelIT",
"--additional=CommandDeduplicationPeriodValidationIT",
"--additional=CompletionDeduplicationInfoITCommandService",
"--additional=CompletionDeduplicationInfoITCommandSubmissionService",
"--additional=ContractIdIT:Accept",
"--additional=ParticipantPruningIT",
"--additional=MultiPartySubmissionIT",
# Disable tests targeting only multi-participant setups
"--exclude=ParticipantPruningIT:PRImmediateAndRetroactiveDivulgence",
],
)
conformance_test(
name = "conformance-test-conflict-checking-static-time",
ports = [6865],
server = ":app",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=example,port=6865",
"--mutable-contract-state-cache",
"--enable-conflict-checking",
"--static-time",
],
test_tool_args = [
"--verbose",
"--static-time",
"--additional=ParticipantPruningIT",
"--additional=MultiPartySubmissionIT",
# Disable tests targeting only multi-participant setups
"--exclude=ParticipantPruningIT:PRImmediateAndRetroactiveDivulgence",
],
)
conformance_test(
name = "benchmark-performance-envelope",
ports = [6865],
server = ":app",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant=participant-id=example,port=6865",
"--mutable-contract-state-cache",
],
test_tool_args = [
"--verbose",
"--perf-tests=PerformanceEnvelope.Throughput.TwentyOPS",
"--perf-tests=PerformanceEnvelope.Latency.1000ms",
"--perf-tests=PerformanceEnvelope.TransactionSize.1000KB",
],
)