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

kvutils/app: Create a test case for the Runner. [KVL-663] #12374

Merged
4 commits merged into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions ledger/ledger-on-memory/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ da_scala_library(
srcs = glob(["src/app/scala/**/*.scala"]),
resources = glob(["src/app/resources/**/*"]),
scala_deps = [
"@maven//:com_github_scopt_scopt",
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
],
Expand All @@ -108,7 +107,6 @@ da_scala_library(
"//daml-lf/engine",
"//language-support/scala/bindings",
"//ledger/caching",
"//ledger/ledger-api-auth",
"//ledger/ledger-api-common",
"//ledger/ledger-api-health",
"//ledger/ledger-configuration",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package com.daml.ledger.on.memory

import com.daml.ledger.participant.state.kvutils.app.{Config, Runner}
import com.daml.ledger.participant.state.kvutils.app.{Config, ConfigProvider, Runner}
import com.daml.ledger.resources.ResourceOwner

object Owner {
Expand All @@ -13,6 +13,6 @@ object Owner {
dispatcher <- dispatcherOwner
sharedState = InMemoryState.empty
factory = new InMemoryLedgerFactory(dispatcher, sharedState)
runner <- new Runner(RunnerName, factory, InMemoryConfigProvider).owner(config)
runner <- new Runner(RunnerName, factory, ConfigProvider.ForUnit).owner(config)
} yield runner
}
26 changes: 21 additions & 5 deletions ledger/participant-state/kvutils/app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ da_scala_library(
"@maven//:com_github_scopt_scopt",
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
tags = ["maven_coordinates=com.daml:participant-state-kvutils-app:__VERSION__"],
visibility = [
Expand Down Expand Up @@ -60,27 +59,44 @@ da_scala_library(
da_scala_test_suite(
name = "app-tests",
size = "small",
srcs = glob(["src/test/**/*.scala"]),
srcs = glob(["src/test/scala/**/*.scala"]),
resources = glob(["src/test/resources/**/*"]),
scala_deps = [
"@maven//:com_github_scopt_scopt",
"@maven//:org_mockito_mockito_scala",
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_matchers_core",
"@maven//:org_scalatest_scalatest_shouldmatchers",
"@maven//:org_scalatest_scalatest_wordspec",
],
deps = [
":app",
"//daml-lf/archive:daml_lf_1.dev_archive_proto_java",
"//daml-lf/data",
"//daml-lf/engine",
"//daml-lf/transaction",
"//ledger-api/grpc-definitions:ledger_api_proto_scala",
"//ledger-api/rs-grpc-bridge",
"//ledger-api/testing-utils",
"//ledger/caching",
"//ledger/ledger-api-common",
"//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/kvutils",
"//libs-scala/postgresql-testing",
"//libs-scala/contextualized-logging",
"//libs-scala/ports",
"//libs-scala/resources",
"//libs-scala/resources-akka",
"//libs-scala/resources-grpc",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:io_grpc_grpc_api",
"@maven//:io_netty_netty_handler",
"@maven//:org_mockito_mockito_core",
"@maven//:org_scalatest_scalatest_compatible",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,11 @@ trait ConfigProvider[ExtraConfig] {
new Metrics(SharedMetricRegistries.getOrCreate(registryName))
}
}

object ConfigProvider {
object ForUnit extends ConfigProvider[Unit] {
override val defaultExtraConfig: Unit = ()

override def extraConfigParser(parser: OptionParser[Config[Unit]]): Unit = ()
}
}
Loading