daml/ledger/ledger-on-sql/BUILD.bazel

474 lines
18 KiB
Python
Raw Normal View History

# Copyright (c) 2021 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",
"silencer_plugin",
)
load("//ledger/ledger-api-test-tool:conformance.bzl", "conformance_test")
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
load("@oracle//:index.bzl", "oracle_testing")
supported_databases = [
{
ledger-on-sql: Get H2 working in the conformance tests. (#4155) * kvutils: Make logback.xml a base file, rather than the only option. * kvutils/app: Simplify logback.base.xml. Mostly by getting rid of unnecessary appenders. * ledger-on-sql: Add trace logging for all database work. * Upgrade H2; there's a few useful bug fixes. * kvutils/app: Let the user override the server JDBC URL. * kvutils/app: Provide a way to specify the ledger ID. * ledger-on-sql: If there are missing entries in the log, fail on read. This can happen right now because we insert in parallel. Next step: stop doing that. * ledger-on-sql: Stop writing in parallel; it causes race conditions. This unfortunately means we also stop _reading_ in parallel, which is less fun. * Revert "ledger-on-sql: Use a sequential log entry ID." This reverts commit c58265bf43b96d16bfa62ed30a795f365b1e83f2. * ledger-on-sql: Create tables with columns that are not nullable. * ledger-on-sql: The H2 conformance tests now work, just slowly. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Run tests against H2 and SQLite on memory and disk. * ledger-on-sql: Allow H2 to read from the log in parallel with writes. * ledger-on-sql: Use UUIDs for entry IDs, not 8 random bytes. * ledger-on-sql: Make sure to log the correlation ID. * ledger-on-sql: Do less while holding a database connection. * ledger-on-sql: Log the connection. * ledger-on-sql: We don't need to tell H2 not to drop the connection. The connection pool takes care of that. * ledger-on-sql: Disable H2 conformance tests on CI; they're too slow. * ledger-on-sql: Rename `loggingContext` to `logCtx`. * ledger-on-sql: Don't abuse log contexts; put the data in the message. * ledger-on-sql: Make the connection log line easier to read. And pull out the logger, even if it's only used once. * ledger-on-sql: Run the unit tests against (H2, SQLite) * (memory, file).
2020-01-22 18:54:51 +03:00
"name": "h2-memory",
"runtime_deps": [
"@maven//:com_h2database_h2",
],
"conformance_test_tags": [
"manual",
],
"conformance_test_server_args": [
ledger-on-sql: Get H2 working in the conformance tests. (#4155) * kvutils: Make logback.xml a base file, rather than the only option. * kvutils/app: Simplify logback.base.xml. Mostly by getting rid of unnecessary appenders. * ledger-on-sql: Add trace logging for all database work. * Upgrade H2; there's a few useful bug fixes. * kvutils/app: Let the user override the server JDBC URL. * kvutils/app: Provide a way to specify the ledger ID. * ledger-on-sql: If there are missing entries in the log, fail on read. This can happen right now because we insert in parallel. Next step: stop doing that. * ledger-on-sql: Stop writing in parallel; it causes race conditions. This unfortunately means we also stop _reading_ in parallel, which is less fun. * Revert "ledger-on-sql: Use a sequential log entry ID." This reverts commit c58265bf43b96d16bfa62ed30a795f365b1e83f2. * ledger-on-sql: Create tables with columns that are not nullable. * ledger-on-sql: The H2 conformance tests now work, just slowly. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Run tests against H2 and SQLite on memory and disk. * ledger-on-sql: Allow H2 to read from the log in parallel with writes. * ledger-on-sql: Use UUIDs for entry IDs, not 8 random bytes. * ledger-on-sql: Make sure to log the correlation ID. * ledger-on-sql: Do less while holding a database connection. * ledger-on-sql: Log the connection. * ledger-on-sql: We don't need to tell H2 not to drop the connection. The connection pool takes care of that. * ledger-on-sql: Disable H2 conformance tests on CI; they're too slow. * ledger-on-sql: Rename `loggingContext` to `logCtx`. * ledger-on-sql: Don't abuse log contexts; put the data in the message. * ledger-on-sql: Make the connection log line easier to read. And pull out the logger, even if it's only used once. * ledger-on-sql: Run the unit tests against (H2, SQLite) * (memory, file).
2020-01-22 18:54:51 +03:00
"--jdbc-url=jdbc:h2:mem:daml-on-sql-conformance-test",
],
},
{
"name": "postgresql",
ledger-on-sql: Get H2 working in the conformance tests. (#4155) * kvutils: Make logback.xml a base file, rather than the only option. * kvutils/app: Simplify logback.base.xml. Mostly by getting rid of unnecessary appenders. * ledger-on-sql: Add trace logging for all database work. * Upgrade H2; there's a few useful bug fixes. * kvutils/app: Let the user override the server JDBC URL. * kvutils/app: Provide a way to specify the ledger ID. * ledger-on-sql: If there are missing entries in the log, fail on read. This can happen right now because we insert in parallel. Next step: stop doing that. * ledger-on-sql: Stop writing in parallel; it causes race conditions. This unfortunately means we also stop _reading_ in parallel, which is less fun. * Revert "ledger-on-sql: Use a sequential log entry ID." This reverts commit c58265bf43b96d16bfa62ed30a795f365b1e83f2. * ledger-on-sql: Create tables with columns that are not nullable. * ledger-on-sql: The H2 conformance tests now work, just slowly. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Run tests against H2 and SQLite on memory and disk. * ledger-on-sql: Allow H2 to read from the log in parallel with writes. * ledger-on-sql: Use UUIDs for entry IDs, not 8 random bytes. * ledger-on-sql: Make sure to log the correlation ID. * ledger-on-sql: Do less while holding a database connection. * ledger-on-sql: Log the connection. * ledger-on-sql: We don't need to tell H2 not to drop the connection. The connection pool takes care of that. * ledger-on-sql: Disable H2 conformance tests on CI; they're too slow. * ledger-on-sql: Rename `loggingContext` to `logCtx`. * ledger-on-sql: Don't abuse log contexts; put the data in the message. * ledger-on-sql: Make the connection log line easier to read. And pull out the logger, even if it's only used once. * ledger-on-sql: Run the unit tests against (H2, SQLite) * (memory, file).
2020-01-22 18:54:51 +03:00
"runtime_deps": [
"@maven//:org_postgresql_postgresql",
ledger-on-sql: Get H2 working in the conformance tests. (#4155) * kvutils: Make logback.xml a base file, rather than the only option. * kvutils/app: Simplify logback.base.xml. Mostly by getting rid of unnecessary appenders. * ledger-on-sql: Add trace logging for all database work. * Upgrade H2; there's a few useful bug fixes. * kvutils/app: Let the user override the server JDBC URL. * kvutils/app: Provide a way to specify the ledger ID. * ledger-on-sql: If there are missing entries in the log, fail on read. This can happen right now because we insert in parallel. Next step: stop doing that. * ledger-on-sql: Stop writing in parallel; it causes race conditions. This unfortunately means we also stop _reading_ in parallel, which is less fun. * Revert "ledger-on-sql: Use a sequential log entry ID." This reverts commit c58265bf43b96d16bfa62ed30a795f365b1e83f2. * ledger-on-sql: Create tables with columns that are not nullable. * ledger-on-sql: The H2 conformance tests now work, just slowly. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Run tests against H2 and SQLite on memory and disk. * ledger-on-sql: Allow H2 to read from the log in parallel with writes. * ledger-on-sql: Use UUIDs for entry IDs, not 8 random bytes. * ledger-on-sql: Make sure to log the correlation ID. * ledger-on-sql: Do less while holding a database connection. * ledger-on-sql: Log the connection. * ledger-on-sql: We don't need to tell H2 not to drop the connection. The connection pool takes care of that. * ledger-on-sql: Disable H2 conformance tests on CI; they're too slow. * ledger-on-sql: Rename `loggingContext` to `logCtx`. * ledger-on-sql: Don't abuse log contexts; put the data in the message. * ledger-on-sql: Make the connection log line easier to read. And pull out the logger, even if it's only used once. * ledger-on-sql: Run the unit tests against (H2, SQLite) * (memory, file).
2020-01-22 18:54:51 +03:00
],
"conformance_test_server_main": "com.daml.ledger.on.sql.MainWithEphemeralPostgresql",
ledger-on-sql: Get H2 working in the conformance tests. (#4155) * kvutils: Make logback.xml a base file, rather than the only option. * kvutils/app: Simplify logback.base.xml. Mostly by getting rid of unnecessary appenders. * ledger-on-sql: Add trace logging for all database work. * Upgrade H2; there's a few useful bug fixes. * kvutils/app: Let the user override the server JDBC URL. * kvutils/app: Provide a way to specify the ledger ID. * ledger-on-sql: If there are missing entries in the log, fail on read. This can happen right now because we insert in parallel. Next step: stop doing that. * ledger-on-sql: Stop writing in parallel; it causes race conditions. This unfortunately means we also stop _reading_ in parallel, which is less fun. * Revert "ledger-on-sql: Use a sequential log entry ID." This reverts commit c58265bf43b96d16bfa62ed30a795f365b1e83f2. * ledger-on-sql: Create tables with columns that are not nullable. * ledger-on-sql: The H2 conformance tests now work, just slowly. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Run tests against H2 and SQLite on memory and disk. * ledger-on-sql: Allow H2 to read from the log in parallel with writes. * ledger-on-sql: Use UUIDs for entry IDs, not 8 random bytes. * ledger-on-sql: Make sure to log the correlation ID. * ledger-on-sql: Do less while holding a database connection. * ledger-on-sql: Log the connection. * ledger-on-sql: We don't need to tell H2 not to drop the connection. The connection pool takes care of that. * ledger-on-sql: Disable H2 conformance tests on CI; they're too slow. * ledger-on-sql: Rename `loggingContext` to `logCtx`. * ledger-on-sql: Don't abuse log contexts; put the data in the message. * ledger-on-sql: Make the connection log line easier to read. And pull out the logger, even if it's only used once. * ledger-on-sql: Run the unit tests against (H2, SQLite) * (memory, file).
2020-01-22 18:54:51 +03:00
},
{
"name": "sqlite-memory",
"runtime_deps": [
"@maven//:org_xerial_sqlite_jdbc",
],
"conformance_test_server_args": [
"--jdbc-url=jdbc:sqlite:file:daml-on-sql-conformance-test?mode=memory&cache=shared",
],
ledger-on-sql: Get H2 working in the conformance tests. (#4155) * kvutils: Make logback.xml a base file, rather than the only option. * kvutils/app: Simplify logback.base.xml. Mostly by getting rid of unnecessary appenders. * ledger-on-sql: Add trace logging for all database work. * Upgrade H2; there's a few useful bug fixes. * kvutils/app: Let the user override the server JDBC URL. * kvutils/app: Provide a way to specify the ledger ID. * ledger-on-sql: If there are missing entries in the log, fail on read. This can happen right now because we insert in parallel. Next step: stop doing that. * ledger-on-sql: Stop writing in parallel; it causes race conditions. This unfortunately means we also stop _reading_ in parallel, which is less fun. * Revert "ledger-on-sql: Use a sequential log entry ID." This reverts commit c58265bf43b96d16bfa62ed30a795f365b1e83f2. * ledger-on-sql: Create tables with columns that are not nullable. * ledger-on-sql: The H2 conformance tests now work, just slowly. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Run tests against H2 and SQLite on memory and disk. * ledger-on-sql: Allow H2 to read from the log in parallel with writes. * ledger-on-sql: Use UUIDs for entry IDs, not 8 random bytes. * ledger-on-sql: Make sure to log the correlation ID. * ledger-on-sql: Do less while holding a database connection. * ledger-on-sql: Log the connection. * ledger-on-sql: We don't need to tell H2 not to drop the connection. The connection pool takes care of that. * ledger-on-sql: Disable H2 conformance tests on CI; they're too slow. * ledger-on-sql: Rename `loggingContext` to `logCtx`. * ledger-on-sql: Don't abuse log contexts; put the data in the message. * ledger-on-sql: Make the connection log line easier to read. And pull out the logger, even if it's only used once. * ledger-on-sql: Run the unit tests against (H2, SQLite) * (memory, file).
2020-01-22 18:54:51 +03:00
},
]
ledger-on-sql: Migrate tables using Flyway. (#4232) * ledger-on-sql: Pull out a superclass for the various integration tests. * ledger-on-sql: Use Flyway to migrate tables in an idempotent manner. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Make it easy to run it with Bazel for experimentation. * ledger-on-sql: Test that migrations will never change in the future. * ledger-on-sql: Add a prefix of "ledger_" to the tables. This is so we don't accidentally conflict with the index when the schemas are shared. I am letting myself modify the migrations because the existing migrations haven't been merged into `master` yet. * ledger-on-sql: Explain why we change the pool size after migration. * ledger-api-test-tool: Tests now specify a timeout scale, not a timeout. Makes it easier to change the default timeout in one place. * ledger-api-test-tool: Increase timeouts on slow tests. These tests produce a lot of volume and can make CI flaky. * ledger-on-sql: Only tear down PostgreSQL in tests. For other databases, we just create a new file for each test case. * ledger-on-sql: Reduce the log output in tests. * ledger-on-sql: Use a separate connection pool for Flyway when possible. Apparently `setMaximumPoolSize` doesn't really have the desired effect after the connection pool has already been used. The new test case will be flaky if we process more than one commit in parallel. For SQLite, it seems to be OK. * ledger-on-sql: Use a separate connection pool for Flyway with SQLite. Except in memory. * ledger-on-sql: Use a separate PostgreSQL database for each test. Because performance, innit. Don't have to tear them down. * ledger-on-sql: Move the `Queries` values inside the `RDBMS` objects. * ledger-on-sql: Go into even more detail about pool size hijinks. Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-01-28 19:16:23 +03:00
all_database_runtime_deps = {dep: None for db in supported_databases for dep in db["runtime_deps"]}.keys()
da_scala_library(
name = "ledger-on-sql",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_playframework_anorm_anorm",
"@maven//:org_playframework_anorm_anorm_tokenizer",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalaz_scalaz_core",
],
tags = ["maven_coordinates=com.daml:ledger-on-sql:__VERSION__"],
visibility = [
"//visibility:public",
],
deps = [
"//daml-lf/data",
"//daml-lf/engine",
"//language-support/scala/bindings",
"//ledger/caching",
"//ledger/ledger-api-common",
Sandbox & kvutils: Use the existing ledger ID if no ledger ID is specified. (#4607) * sandbox: If the ledger ID isn't provided, use the one in the database. Previously, we would fail if working against an existing ledger, and not explicitly providing the ledger ID. This was the case even if the ledger ID was randomly generated initially. CHANGELOG_BEGIN - [Sandbox] If no ledger ID is provided when running against an existing ledger, use the existing ID. Previously, Sandbox would fail to start. CHANGELOG_END * sandbox: The ReadOnlySqlLedger should always receive a ledger ID. It's read-only; it can't create one. * sandbox: Stop using `equal` in SqlLedgerSpec. * sandbox: Test that the ledger ID is as specified in SqlLedgerSpec. * sandbox: Let the top-level runner handle a ledger ID mismatch. And clean up the log text. * sandbox: Initialize the ledger properly when the ID is dynamic. * sandbox: Use `Vector`, not `List`, for SqlLedger initialization. Append with Vector, good. List, bad. * ledger-api-common: Make `LedgerApiMode.Dynamic` an object. And add Java-style static factory methods. * kvutils/app | ledger-on-{memory,sql}: Make `ledgerId` optional. It should be generated or retrieved from the persistence layer by the ledger itself. * kvutils: Make the ledger ID optional in the tests. * ledger-on-sql: Store the ledger ID, and reject conflicting IDs. * ledger-on-sql: Make more things final. * ledger-on-sql: Document the `ledger_meta.table_key` column better. * sandbox: Don't hardcode the number of packages in the test DAR. It changes. * ledger-on-sql: Merge the `head` resource owner with the `dispatcher`. * sandbox: Use backticks to simplify pattern match in ReadOnlySqlLedger. * ledger-on-sql: Extract methods in `owner`.
2020-02-20 13:35:16 +03:00
"//ledger/ledger-api-domain",
"//ledger/ledger-api-health",
"//ledger/ledger-configuration",
"//ledger/ledger-offset",
resources: Customizable contexts. (#7678) * resources: Move builders into //ledger/ledger-resources. Keep the actual constructors in a trait, but instantiate it when working with ledger code. This allows us to later introduce an extra "context" type parameter to ResourceOwner. * resources-akka: Move the builders in to //ledger/ledger-resources. * resources: Introduce an abstract `Context` parameter for owners. This replaces the concrete `ExecutionContext`. While it _can_ be an execution context, it really doesn't matter as long as we can get at one somehow. This is being introduced so we can wrap the context in a container, either for type tagging or to include extra information. Because our current context _is_ `ExecutionContext`, and an implicit is provided to extract it, we can end up with two ways to get the same value. We use shadowing to prevent this. This problem should go away in the near future when a new context type is added. CHANGELOG_BEGIN - [Integration Kit] The `ResourceOwner` type is now parameterized by a `Context`, which is filled in by the corresponding `Context` class in the _ledger-resources_ dependency. This allows us to pass extra information through resource acquisition. CHANGELOG_END * ledger-resources: Move `ResourceOwner` here from `resources`. * ledger-resources: Remove dependencies from outside //ledger. * ledger-resource: Wrap the acquisition execution context in `Context`. So we can add a logging context to it. * resources: Pass the Context, not the ExecutionContext, to Resource. * Avoid importing `HasExecutionContext`. * ledger-resources: Publish to Maven Central. * resources: Make the small changes suggested by @stefanobaghino-da. Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com> * ledger-resources: Pull out a trait for test resource contexts. Saves a few lines of code. * Restore some imports that were accidentally wildcarded. * resources: Replace an `implicit def` with a couple of imports. * participant-integration-api: Simplify the JdbcLedgerDaoBackend tests. Try and use the right execution context where possible. Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-10-20 12:26:28 +03:00
"//ledger/ledger-resources",
"//ledger/metrics",
"//ledger/participant-state",
"//ledger/participant-state/kvutils",
"//libs-scala/concurrent",
ledger-on-sql: Get H2 working in the conformance tests. (#4155) * kvutils: Make logback.xml a base file, rather than the only option. * kvutils/app: Simplify logback.base.xml. Mostly by getting rid of unnecessary appenders. * ledger-on-sql: Add trace logging for all database work. * Upgrade H2; there's a few useful bug fixes. * kvutils/app: Let the user override the server JDBC URL. * kvutils/app: Provide a way to specify the ledger ID. * ledger-on-sql: If there are missing entries in the log, fail on read. This can happen right now because we insert in parallel. Next step: stop doing that. * ledger-on-sql: Stop writing in parallel; it causes race conditions. This unfortunately means we also stop _reading_ in parallel, which is less fun. * Revert "ledger-on-sql: Use a sequential log entry ID." This reverts commit c58265bf43b96d16bfa62ed30a795f365b1e83f2. * ledger-on-sql: Create tables with columns that are not nullable. * ledger-on-sql: The H2 conformance tests now work, just slowly. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Run tests against H2 and SQLite on memory and disk. * ledger-on-sql: Allow H2 to read from the log in parallel with writes. * ledger-on-sql: Use UUIDs for entry IDs, not 8 random bytes. * ledger-on-sql: Make sure to log the correlation ID. * ledger-on-sql: Do less while holding a database connection. * ledger-on-sql: Log the connection. * ledger-on-sql: We don't need to tell H2 not to drop the connection. The connection pool takes care of that. * ledger-on-sql: Disable H2 conformance tests on CI; they're too slow. * ledger-on-sql: Rename `loggingContext` to `logCtx`. * ledger-on-sql: Don't abuse log contexts; put the data in the message. * ledger-on-sql: Make the connection log line easier to read. And pull out the logger, even if it's only used once. * ledger-on-sql: Run the unit tests against (H2, SQLite) * (memory, file).
2020-01-22 18:54:51 +03:00
"//libs-scala/contextualized-logging",
"//libs-scala/resources",
resources: Customizable contexts. (#7678) * resources: Move builders into //ledger/ledger-resources. Keep the actual constructors in a trait, but instantiate it when working with ledger code. This allows us to later introduce an extra "context" type parameter to ResourceOwner. * resources-akka: Move the builders in to //ledger/ledger-resources. * resources: Introduce an abstract `Context` parameter for owners. This replaces the concrete `ExecutionContext`. While it _can_ be an execution context, it really doesn't matter as long as we can get at one somehow. This is being introduced so we can wrap the context in a container, either for type tagging or to include extra information. Because our current context _is_ `ExecutionContext`, and an implicit is provided to extract it, we can end up with two ways to get the same value. We use shadowing to prevent this. This problem should go away in the near future when a new context type is added. CHANGELOG_BEGIN - [Integration Kit] The `ResourceOwner` type is now parameterized by a `Context`, which is filled in by the corresponding `Context` class in the _ledger-resources_ dependency. This allows us to pass extra information through resource acquisition. CHANGELOG_END * ledger-resources: Move `ResourceOwner` here from `resources`. * ledger-resources: Remove dependencies from outside //ledger. * ledger-resource: Wrap the acquisition execution context in `Context`. So we can add a logging context to it. * resources: Pass the Context, not the ExecutionContext, to Resource. * Avoid importing `HasExecutionContext`. * ledger-resources: Publish to Maven Central. * resources: Make the small changes suggested by @stefanobaghino-da. Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com> * ledger-resources: Pull out a trait for test resource contexts. Saves a few lines of code. * Restore some imports that were accidentally wildcarded. * resources: Replace an `implicit def` with a couple of imports. * participant-integration-api: Simplify the JdbcLedgerDaoBackend tests. Try and use the right execution context where possible. Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-10-20 12:26:28 +03:00
"//libs-scala/resources-akka",
"//libs-scala/resources-grpc",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_zaxxer_HikariCP",
"@maven//:io_dropwizard_metrics_metrics_core",
ledger-on-sql: Migrate tables using Flyway. (#4232) * ledger-on-sql: Pull out a superclass for the various integration tests. * ledger-on-sql: Use Flyway to migrate tables in an idempotent manner. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Make it easy to run it with Bazel for experimentation. * ledger-on-sql: Test that migrations will never change in the future. * ledger-on-sql: Add a prefix of "ledger_" to the tables. This is so we don't accidentally conflict with the index when the schemas are shared. I am letting myself modify the migrations because the existing migrations haven't been merged into `master` yet. * ledger-on-sql: Explain why we change the pool size after migration. * ledger-api-test-tool: Tests now specify a timeout scale, not a timeout. Makes it easier to change the default timeout in one place. * ledger-api-test-tool: Increase timeouts on slow tests. These tests produce a lot of volume and can make CI flaky. * ledger-on-sql: Only tear down PostgreSQL in tests. For other databases, we just create a new file for each test case. * ledger-on-sql: Reduce the log output in tests. * ledger-on-sql: Use a separate connection pool for Flyway when possible. Apparently `setMaximumPoolSize` doesn't really have the desired effect after the connection pool has already been used. The new test case will be flaky if we process more than one commit in parallel. For SQLite, it seems to be OK. * ledger-on-sql: Use a separate connection pool for Flyway with SQLite. Except in memory. * ledger-on-sql: Use a separate PostgreSQL database for each test. Because performance, innit. Don't have to tear them down. * ledger-on-sql: Move the `Queries` values inside the `RDBMS` objects. * ledger-on-sql: Go into even more detail about pool size hijinks. Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-01-28 19:16:23 +03:00
"@maven//:org_flywaydb_flyway_core",
],
)
da_scala_library(
name = "ledger-on-sql-app",
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",
],
visibility = ["//visibility:public"],
deps = [
":ledger-on-sql",
"//daml-lf/data",
"//daml-lf/engine",
"//language-support/scala/bindings",
"//ledger/caching",
"//ledger/ledger-api-auth",
"//ledger/ledger-api-health",
"//ledger/ledger-configuration",
resources: Customizable contexts. (#7678) * resources: Move builders into //ledger/ledger-resources. Keep the actual constructors in a trait, but instantiate it when working with ledger code. This allows us to later introduce an extra "context" type parameter to ResourceOwner. * resources-akka: Move the builders in to //ledger/ledger-resources. * resources: Introduce an abstract `Context` parameter for owners. This replaces the concrete `ExecutionContext`. While it _can_ be an execution context, it really doesn't matter as long as we can get at one somehow. This is being introduced so we can wrap the context in a container, either for type tagging or to include extra information. Because our current context _is_ `ExecutionContext`, and an implicit is provided to extract it, we can end up with two ways to get the same value. We use shadowing to prevent this. This problem should go away in the near future when a new context type is added. CHANGELOG_BEGIN - [Integration Kit] The `ResourceOwner` type is now parameterized by a `Context`, which is filled in by the corresponding `Context` class in the _ledger-resources_ dependency. This allows us to pass extra information through resource acquisition. CHANGELOG_END * ledger-resources: Move `ResourceOwner` here from `resources`. * ledger-resources: Remove dependencies from outside //ledger. * ledger-resource: Wrap the acquisition execution context in `Context`. So we can add a logging context to it. * resources: Pass the Context, not the ExecutionContext, to Resource. * Avoid importing `HasExecutionContext`. * ledger-resources: Publish to Maven Central. * resources: Make the small changes suggested by @stefanobaghino-da. Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com> * ledger-resources: Pull out a trait for test resource contexts. Saves a few lines of code. * Restore some imports that were accidentally wildcarded. * resources: Replace an `implicit def` with a couple of imports. * participant-integration-api: Simplify the JdbcLedgerDaoBackend tests. Try and use the right execution context where possible. Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-10-20 12:26:28 +03:00
"//ledger/ledger-resources",
"//ledger/metrics",
"//ledger/participant-integration-api",
"//ledger/participant-state",
"//ledger/participant-state/kvutils",
"//ledger/participant-state/kvutils/app",
"//libs-scala/contextualized-logging",
"//libs-scala/ports",
"//libs-scala/resources",
],
)
ledger-on-sql: Migrate tables using Flyway. (#4232) * ledger-on-sql: Pull out a superclass for the various integration tests. * ledger-on-sql: Use Flyway to migrate tables in an idempotent manner. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Make it easy to run it with Bazel for experimentation. * ledger-on-sql: Test that migrations will never change in the future. * ledger-on-sql: Add a prefix of "ledger_" to the tables. This is so we don't accidentally conflict with the index when the schemas are shared. I am letting myself modify the migrations because the existing migrations haven't been merged into `master` yet. * ledger-on-sql: Explain why we change the pool size after migration. * ledger-api-test-tool: Tests now specify a timeout scale, not a timeout. Makes it easier to change the default timeout in one place. * ledger-api-test-tool: Increase timeouts on slow tests. These tests produce a lot of volume and can make CI flaky. * ledger-on-sql: Only tear down PostgreSQL in tests. For other databases, we just create a new file for each test case. * ledger-on-sql: Reduce the log output in tests. * ledger-on-sql: Use a separate connection pool for Flyway when possible. Apparently `setMaximumPoolSize` doesn't really have the desired effect after the connection pool has already been used. The new test case will be flaky if we process more than one commit in parallel. For SQLite, it seems to be OK. * ledger-on-sql: Use a separate connection pool for Flyway with SQLite. Except in memory. * ledger-on-sql: Use a separate PostgreSQL database for each test. Because performance, innit. Don't have to tear them down. * ledger-on-sql: Move the `Queries` values inside the `RDBMS` objects. * ledger-on-sql: Go into even more detail about pool size hijinks. Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-01-28 19:16:23 +03:00
da_scala_binary(
name = "app",
main_class = "com.daml.ledger.on.sql.Main",
visibility = ["//visibility:public"],
runtime_deps = [
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
] + all_database_runtime_deps,
ledger-on-sql: Migrate tables using Flyway. (#4232) * ledger-on-sql: Pull out a superclass for the various integration tests. * ledger-on-sql: Use Flyway to migrate tables in an idempotent manner. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Make it easy to run it with Bazel for experimentation. * ledger-on-sql: Test that migrations will never change in the future. * ledger-on-sql: Add a prefix of "ledger_" to the tables. This is so we don't accidentally conflict with the index when the schemas are shared. I am letting myself modify the migrations because the existing migrations haven't been merged into `master` yet. * ledger-on-sql: Explain why we change the pool size after migration. * ledger-api-test-tool: Tests now specify a timeout scale, not a timeout. Makes it easier to change the default timeout in one place. * ledger-api-test-tool: Increase timeouts on slow tests. These tests produce a lot of volume and can make CI flaky. * ledger-on-sql: Only tear down PostgreSQL in tests. For other databases, we just create a new file for each test case. * ledger-on-sql: Reduce the log output in tests. * ledger-on-sql: Use a separate connection pool for Flyway when possible. Apparently `setMaximumPoolSize` doesn't really have the desired effect after the connection pool has already been used. The new test case will be flaky if we process more than one commit in parallel. For SQLite, it seems to be OK. * ledger-on-sql: Use a separate connection pool for Flyway with SQLite. Except in memory. * ledger-on-sql: Use a separate PostgreSQL database for each test. Because performance, innit. Don't have to tear them down. * ledger-on-sql: Move the `Queries` values inside the `RDBMS` objects. * ledger-on-sql: Go into even more detail about pool size hijinks. Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-01-28 19:16:23 +03:00
deps = [
":ledger-on-sql-app",
],
)
da_scala_library(
name = "ledger-on-sql-test-lib",
srcs = glob(["src/test/lib/scala/**/*.scala"]),
scala_deps = [
"@maven//:com_github_scopt_scopt",
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_scalactic_scalactic",
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_flatspec",
"@maven//:org_scalatest_scalatest_matchers_core",
"@maven//:org_scalatest_scalatest_shouldmatchers",
"@maven//:org_scalatest_scalatest_wordspec",
"@maven//:org_scalaz_scalaz_core",
],
visibility = [
"//visibility:public",
],
deps = [
":ledger-on-sql",
":ledger-on-sql-app",
"//daml-lf/data",
"//daml-lf/engine",
"//language-support/scala/bindings",
ledger-on-sql: Migrate tables using Flyway. (#4232) * ledger-on-sql: Pull out a superclass for the various integration tests. * ledger-on-sql: Use Flyway to migrate tables in an idempotent manner. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Make it easy to run it with Bazel for experimentation. * ledger-on-sql: Test that migrations will never change in the future. * ledger-on-sql: Add a prefix of "ledger_" to the tables. This is so we don't accidentally conflict with the index when the schemas are shared. I am letting myself modify the migrations because the existing migrations haven't been merged into `master` yet. * ledger-on-sql: Explain why we change the pool size after migration. * ledger-api-test-tool: Tests now specify a timeout scale, not a timeout. Makes it easier to change the default timeout in one place. * ledger-api-test-tool: Increase timeouts on slow tests. These tests produce a lot of volume and can make CI flaky. * ledger-on-sql: Only tear down PostgreSQL in tests. For other databases, we just create a new file for each test case. * ledger-on-sql: Reduce the log output in tests. * ledger-on-sql: Use a separate connection pool for Flyway when possible. Apparently `setMaximumPoolSize` doesn't really have the desired effect after the connection pool has already been used. The new test case will be flaky if we process more than one commit in parallel. For SQLite, it seems to be OK. * ledger-on-sql: Use a separate connection pool for Flyway with SQLite. Except in memory. * ledger-on-sql: Use a separate PostgreSQL database for each test. Because performance, innit. Don't have to tear them down. * ledger-on-sql: Move the `Queries` values inside the `RDBMS` objects. * ledger-on-sql: Go into even more detail about pool size hijinks. Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-01-28 19:16:23 +03:00
"//ledger-api/rs-grpc-bridge",
"//ledger-api/testing-utils",
"//ledger/caching",
"//ledger/ledger-api-health",
"//ledger/ledger-configuration",
resources: Customizable contexts. (#7678) * resources: Move builders into //ledger/ledger-resources. Keep the actual constructors in a trait, but instantiate it when working with ledger code. This allows us to later introduce an extra "context" type parameter to ResourceOwner. * resources-akka: Move the builders in to //ledger/ledger-resources. * resources: Introduce an abstract `Context` parameter for owners. This replaces the concrete `ExecutionContext`. While it _can_ be an execution context, it really doesn't matter as long as we can get at one somehow. This is being introduced so we can wrap the context in a container, either for type tagging or to include extra information. Because our current context _is_ `ExecutionContext`, and an implicit is provided to extract it, we can end up with two ways to get the same value. We use shadowing to prevent this. This problem should go away in the near future when a new context type is added. CHANGELOG_BEGIN - [Integration Kit] The `ResourceOwner` type is now parameterized by a `Context`, which is filled in by the corresponding `Context` class in the _ledger-resources_ dependency. This allows us to pass extra information through resource acquisition. CHANGELOG_END * ledger-resources: Move `ResourceOwner` here from `resources`. * ledger-resources: Remove dependencies from outside //ledger. * ledger-resource: Wrap the acquisition execution context in `Context`. So we can add a logging context to it. * resources: Pass the Context, not the ExecutionContext, to Resource. * Avoid importing `HasExecutionContext`. * ledger-resources: Publish to Maven Central. * resources: Make the small changes suggested by @stefanobaghino-da. Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com> * ledger-resources: Pull out a trait for test resource contexts. Saves a few lines of code. * Restore some imports that were accidentally wildcarded. * resources: Replace an `implicit def` with a couple of imports. * participant-integration-api: Simplify the JdbcLedgerDaoBackend tests. Try and use the right execution context where possible. Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-10-20 12:26:28 +03:00
"//ledger/ledger-resources",
"//ledger/metrics",
"//ledger/participant-integration-api",
"//ledger/participant-state",
"//ledger/participant-state/kvutils",
ledger-on-sql: Migrate tables using Flyway. (#4232) * ledger-on-sql: Pull out a superclass for the various integration tests. * ledger-on-sql: Use Flyway to migrate tables in an idempotent manner. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Make it easy to run it with Bazel for experimentation. * ledger-on-sql: Test that migrations will never change in the future. * ledger-on-sql: Add a prefix of "ledger_" to the tables. This is so we don't accidentally conflict with the index when the schemas are shared. I am letting myself modify the migrations because the existing migrations haven't been merged into `master` yet. * ledger-on-sql: Explain why we change the pool size after migration. * ledger-api-test-tool: Tests now specify a timeout scale, not a timeout. Makes it easier to change the default timeout in one place. * ledger-api-test-tool: Increase timeouts on slow tests. These tests produce a lot of volume and can make CI flaky. * ledger-on-sql: Only tear down PostgreSQL in tests. For other databases, we just create a new file for each test case. * ledger-on-sql: Reduce the log output in tests. * ledger-on-sql: Use a separate connection pool for Flyway when possible. Apparently `setMaximumPoolSize` doesn't really have the desired effect after the connection pool has already been used. The new test case will be flaky if we process more than one commit in parallel. For SQLite, it seems to be OK. * ledger-on-sql: Use a separate connection pool for Flyway with SQLite. Except in memory. * ledger-on-sql: Use a separate PostgreSQL database for each test. Because performance, innit. Don't have to tear them down. * ledger-on-sql: Move the `Queries` values inside the `RDBMS` objects. * ledger-on-sql: Go into even more detail about pool size hijinks. Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-01-28 19:16:23 +03:00
"//ledger/participant-state/kvutils:kvutils-tests-lib",
"//ledger/participant-state/kvutils/app",
"//libs-scala/concurrent",
ledger-on-sql: Migrate tables using Flyway. (#4232) * ledger-on-sql: Pull out a superclass for the various integration tests. * ledger-on-sql: Use Flyway to migrate tables in an idempotent manner. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Make it easy to run it with Bazel for experimentation. * ledger-on-sql: Test that migrations will never change in the future. * ledger-on-sql: Add a prefix of "ledger_" to the tables. This is so we don't accidentally conflict with the index when the schemas are shared. I am letting myself modify the migrations because the existing migrations haven't been merged into `master` yet. * ledger-on-sql: Explain why we change the pool size after migration. * ledger-api-test-tool: Tests now specify a timeout scale, not a timeout. Makes it easier to change the default timeout in one place. * ledger-api-test-tool: Increase timeouts on slow tests. These tests produce a lot of volume and can make CI flaky. * ledger-on-sql: Only tear down PostgreSQL in tests. For other databases, we just create a new file for each test case. * ledger-on-sql: Reduce the log output in tests. * ledger-on-sql: Use a separate connection pool for Flyway when possible. Apparently `setMaximumPoolSize` doesn't really have the desired effect after the connection pool has already been used. The new test case will be flaky if we process more than one commit in parallel. For SQLite, it seems to be OK. * ledger-on-sql: Use a separate connection pool for Flyway with SQLite. Except in memory. * ledger-on-sql: Use a separate PostgreSQL database for each test. Because performance, innit. Don't have to tear them down. * ledger-on-sql: Move the `Queries` values inside the `RDBMS` objects. * ledger-on-sql: Go into even more detail about pool size hijinks. Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-01-28 19:16:23 +03:00
"//libs-scala/contextualized-logging",
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
"//libs-scala/oracle-testing",
"//libs-scala/ports",
"//libs-scala/postgresql-testing",
"//libs-scala/resources",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:org_scalatest_scalatest_compatible",
],
)
da_scala_test_suite(
name = "ledger-on-sql-tests",
srcs = glob(["src/test/suite/**/*.scala"]),
data = [
"//ledger/test-common:model-tests-default.dar",
],
resources = glob(["src/test/resources/*"]),
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_scala_lang_modules_scala_java8_compat",
"@maven//:org_scalactic_scalactic",
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_flatspec",
"@maven//:org_scalatest_scalatest_matchers_core",
"@maven//:org_scalatest_scalatest_shouldmatchers",
"@maven//:org_scalatest_scalatest_wordspec",
"@maven//:org_scalaz_scalaz_core",
],
runtime_deps = [
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
] + all_database_runtime_deps,
deps = [
":ledger-on-sql",
ledger-on-sql: Migrate tables using Flyway. (#4232) * ledger-on-sql: Pull out a superclass for the various integration tests. * ledger-on-sql: Use Flyway to migrate tables in an idempotent manner. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Make it easy to run it with Bazel for experimentation. * ledger-on-sql: Test that migrations will never change in the future. * ledger-on-sql: Add a prefix of "ledger_" to the tables. This is so we don't accidentally conflict with the index when the schemas are shared. I am letting myself modify the migrations because the existing migrations haven't been merged into `master` yet. * ledger-on-sql: Explain why we change the pool size after migration. * ledger-api-test-tool: Tests now specify a timeout scale, not a timeout. Makes it easier to change the default timeout in one place. * ledger-api-test-tool: Increase timeouts on slow tests. These tests produce a lot of volume and can make CI flaky. * ledger-on-sql: Only tear down PostgreSQL in tests. For other databases, we just create a new file for each test case. * ledger-on-sql: Reduce the log output in tests. * ledger-on-sql: Use a separate connection pool for Flyway when possible. Apparently `setMaximumPoolSize` doesn't really have the desired effect after the connection pool has already been used. The new test case will be flaky if we process more than one commit in parallel. For SQLite, it seems to be OK. * ledger-on-sql: Use a separate connection pool for Flyway with SQLite. Except in memory. * ledger-on-sql: Use a separate PostgreSQL database for each test. Because performance, innit. Don't have to tear them down. * ledger-on-sql: Move the `Queries` values inside the `RDBMS` objects. * ledger-on-sql: Go into even more detail about pool size hijinks. Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-01-28 19:16:23 +03:00
":ledger-on-sql-test-lib",
"//daml-lf/data",
"//daml-lf/engine",
"//ledger-api/rs-grpc-bridge",
"//ledger-api/testing-utils",
"//ledger/ledger-api-common",
"//ledger/ledger-api-health",
"//ledger/ledger-configuration",
resources: Customizable contexts. (#7678) * resources: Move builders into //ledger/ledger-resources. Keep the actual constructors in a trait, but instantiate it when working with ledger code. This allows us to later introduce an extra "context" type parameter to ResourceOwner. * resources-akka: Move the builders in to //ledger/ledger-resources. * resources: Introduce an abstract `Context` parameter for owners. This replaces the concrete `ExecutionContext`. While it _can_ be an execution context, it really doesn't matter as long as we can get at one somehow. This is being introduced so we can wrap the context in a container, either for type tagging or to include extra information. Because our current context _is_ `ExecutionContext`, and an implicit is provided to extract it, we can end up with two ways to get the same value. We use shadowing to prevent this. This problem should go away in the near future when a new context type is added. CHANGELOG_BEGIN - [Integration Kit] The `ResourceOwner` type is now parameterized by a `Context`, which is filled in by the corresponding `Context` class in the _ledger-resources_ dependency. This allows us to pass extra information through resource acquisition. CHANGELOG_END * ledger-resources: Move `ResourceOwner` here from `resources`. * ledger-resources: Remove dependencies from outside //ledger. * ledger-resource: Wrap the acquisition execution context in `Context`. So we can add a logging context to it. * resources: Pass the Context, not the ExecutionContext, to Resource. * Avoid importing `HasExecutionContext`. * ledger-resources: Publish to Maven Central. * resources: Make the small changes suggested by @stefanobaghino-da. Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com> * ledger-resources: Pull out a trait for test resource contexts. Saves a few lines of code. * Restore some imports that were accidentally wildcarded. * resources: Replace an `implicit def` with a couple of imports. * participant-integration-api: Simplify the JdbcLedgerDaoBackend tests. Try and use the right execution context where possible. Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-10-20 12:26:28 +03:00
"//ledger/ledger-resources",
"//ledger/ledger-resources:ledger-resources-test-lib",
"//ledger/metrics",
"//ledger/participant-integration-api",
"//ledger/participant-state",
"//ledger/participant-state/kvutils",
"//ledger/participant-state/kvutils:kvutils-tests-lib",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/flyway-testing",
"//libs-scala/postgresql-testing",
"//libs-scala/resources",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:io_dropwizard_metrics_metrics_core",
ledger-on-sql: Migrate tables using Flyway. (#4232) * ledger-on-sql: Pull out a superclass for the various integration tests. * ledger-on-sql: Use Flyway to migrate tables in an idempotent manner. CHANGELOG_BEGIN CHANGELOG_END * ledger-on-sql: Make it easy to run it with Bazel for experimentation. * ledger-on-sql: Test that migrations will never change in the future. * ledger-on-sql: Add a prefix of "ledger_" to the tables. This is so we don't accidentally conflict with the index when the schemas are shared. I am letting myself modify the migrations because the existing migrations haven't been merged into `master` yet. * ledger-on-sql: Explain why we change the pool size after migration. * ledger-api-test-tool: Tests now specify a timeout scale, not a timeout. Makes it easier to change the default timeout in one place. * ledger-api-test-tool: Increase timeouts on slow tests. These tests produce a lot of volume and can make CI flaky. * ledger-on-sql: Only tear down PostgreSQL in tests. For other databases, we just create a new file for each test case. * ledger-on-sql: Reduce the log output in tests. * ledger-on-sql: Use a separate connection pool for Flyway when possible. Apparently `setMaximumPoolSize` doesn't really have the desired effect after the connection pool has already been used. The new test case will be flaky if we process more than one commit in parallel. For SQLite, it seems to be OK. * ledger-on-sql: Use a separate connection pool for Flyway with SQLite. Except in memory. * ledger-on-sql: Use a separate PostgreSQL database for each test. Because performance, innit. Don't have to tear them down. * ledger-on-sql: Move the `Queries` values inside the `RDBMS` objects. * ledger-on-sql: Go into even more detail about pool size hijinks. Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-01-28 19:16:23 +03:00
"@maven//:org_flywaydb_flyway_core",
"@maven//:org_scalatest_scalatest_compatible",
],
)
[
(
da_scala_binary(
name = "conformance-test-{}-bin".format(db["name"]),
main_class = db.get("conformance_test_server_main", "com.daml.ledger.on.sql.Main"),
visibility = ["//visibility:public"],
runtime_deps = db.get("runtime_deps", []),
deps = [
":ledger-on-sql",
":ledger-on-sql-test-lib",
],
),
conformance_test(
name = "conformance-test-{}".format(db["name"]),
lf_versions = [
"default",
"latest",
"preview",
],
ports = [6865],
server = ":conformance-test-{}-bin".format(db["name"]),
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865",
"--max-deduplication-duration=PT5S",
] + db.get("conformance_test_server_args", []),
tags = db.get("conformance_test_tags", []),
test_tool_args = db.get("conformance_test_tool_args", []) + [
"--verbose",
"--additional=ParticipantPruningIT",
"--additional=MultiPartySubmissionIT",
"--additional=KVCommandDeduplicationIT",
"--exclude=CommandDeduplicationIT", # It's a KV ledger so it needs the KV variant
# Disable tests targeting only append-only schema functionality
"--exclude=ParticipantPruningIT:PRLocalAndNonLocalRetroactiveDivulgences,ParticipantPruningIT:PRRetroactiveDivulgences,ParticipantPruningIT:PRImmediateAndRetroactiveDivulgence",
],
),
conformance_test(
name = "benchmark-performance-envelope-{}".format(db["name"]),
ports = [6865],
server = ":conformance-test-{}-bin".format(db["name"]),
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=example,port=6865",
] + db.get("conformance_test_server_args", []),
tags = db.get("benchmark_performance_envelope_tags", []),
test_tool_args = db.get("benchmark_performance_envelope_tags", []) + [
"--verbose",
"--perf-tests=PerformanceEnvelope.Throughput.TwentyOPS",
"--perf-tests=PerformanceEnvelope.Latency.1000ms",
"--perf-tests=PerformanceEnvelope.TransactionSize.1000KB",
],
),
)
for db in supported_databases
]
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
da_scala_binary(
name = "conformance-test-oracle-bin",
main_class = "com.daml.ledger.on.sql.MainWithEphemeralOracleUser",
visibility = ["//visibility:public"],
runtime_deps = [
"@maven//:com_oracle_database_jdbc_ojdbc8",
],
deps = [
":ledger-on-sql",
":ledger-on-sql-test-lib",
],
)
conformance_test(
name = "conformance-test-append-only-postgres",
ports = [6865],
server = ":conformance-test-postgresql-bin",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1",
"--index-append-only-schema",
"--mutable-contract-state-cache",
"--max-deduplication-duration=PT5S",
],
tags = [],
test_tool_args = [
"--verbose",
"--additional=AppendOnlyCommandDeduplicationParallelIT",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandService",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandSubmissionService",
"--additional=AppendOnlyKVCommandDeduplicationIT",
"--additional=ParticipantPruningIT",
"--additional=MultiPartySubmissionIT",
Command deduplication - Participant side/committer side command deduplication conformance tests split [KVL-1093] (#10784) * Split command deduplication conformance tests into non-kv and kv tests. Because kv ledgers have both participant and committer side deduplication, the conformance tests have been duplicated into different suited which can target either both deduplications or just participant side deduplication. CommandDeduplicationIT is a default suite and should be run for ledgers with participant side only deduplication. KVCommandDeduplicationIT is optional and should be enabled for any KV ledgers. CHANGELOG_BEGIN ledger-api-test-tool - CommandDeduplicationIT tests only participant side deduplication, it should be disabled for KV ledgers. Added KVCommandDeduplicationIT which should be run for KV ledgers CHANGELOG_END * Run participant side/committer side deduplication tests based on the ledger implementation * Fix on memory build file * Daml-on-sql is not a kv ledger so revert the changes so that it runs the default command deduplication IT * Rollback compat import * Exclude command dedup from the reference test * Exclude command deduplication from the reference export * Format bazel * Set the exclude to client args for the ledger-api-test-tool and not for the ledger-on-memory * Exclude CommandDeduplicationIT from non repudiation conformance tests and include KVCommandDeduplicationIT because it runs using sandbox * Exclude HealthServiceIT from the reference-ledger-export as it has no impact on the export * Exclude CommandDeduplicationIT from the ledger-on-sql conformance-test as they are KV ledgers * Format bazel file * Exclude CommandDeduplicationIT from sandbox * Apply suggestions from code review Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com> * Add comments for command deduplication IT * Rename to be consistent with scala namings * Update formatting and comments * Add naming prefix for tests to avoid clashes Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-09-08 13:27:07 +03:00
"--exclude=CommandDeduplicationIT", # It's a KV ledger so it needs the KV variant
# Disable tests targeting only multi-participant setups
"--exclude=ParticipantPruningIT:PRImmediateAndRetroactiveDivulgence",
],
)
conformance_test(
name = "conformance-test-append-only-h2",
ports = [6865],
server = ":conformance-test-h2-memory-bin",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1",
"--index-append-only-schema",
"--mutable-contract-state-cache",
"--jdbc-url=jdbc:h2:mem:daml-on-sql-conformance-test",
"--max-deduplication-duration=PT5S",
],
tags = [],
test_tool_args = [
"--verbose",
"--additional=AppendOnlyCommandDeduplicationParallelIT",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandService",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandSubmissionService",
"--additional=AppendOnlyKVCommandDeduplicationIT",
"--additional=ParticipantPruningIT",
"--additional=MultiPartySubmissionIT",
Command deduplication - Participant side/committer side command deduplication conformance tests split [KVL-1093] (#10784) * Split command deduplication conformance tests into non-kv and kv tests. Because kv ledgers have both participant and committer side deduplication, the conformance tests have been duplicated into different suited which can target either both deduplications or just participant side deduplication. CommandDeduplicationIT is a default suite and should be run for ledgers with participant side only deduplication. KVCommandDeduplicationIT is optional and should be enabled for any KV ledgers. CHANGELOG_BEGIN ledger-api-test-tool - CommandDeduplicationIT tests only participant side deduplication, it should be disabled for KV ledgers. Added KVCommandDeduplicationIT which should be run for KV ledgers CHANGELOG_END * Run participant side/committer side deduplication tests based on the ledger implementation * Fix on memory build file * Daml-on-sql is not a kv ledger so revert the changes so that it runs the default command deduplication IT * Rollback compat import * Exclude command dedup from the reference test * Exclude command deduplication from the reference export * Format bazel * Set the exclude to client args for the ledger-api-test-tool and not for the ledger-on-memory * Exclude CommandDeduplicationIT from non repudiation conformance tests and include KVCommandDeduplicationIT because it runs using sandbox * Exclude HealthServiceIT from the reference-ledger-export as it has no impact on the export * Exclude CommandDeduplicationIT from the ledger-on-sql conformance-test as they are KV ledgers * Format bazel file * Exclude CommandDeduplicationIT from sandbox * Apply suggestions from code review Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com> * Add comments for command deduplication IT * Rename to be consistent with scala namings * Update formatting and comments * Add naming prefix for tests to avoid clashes Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-09-08 13:27:07 +03:00
"--exclude=CommandDeduplicationIT", # It's a KV ledger so it needs the KV variant
# Disable tests targeting only multi-participant setups
"--exclude=ParticipantPruningIT:PRImmediateAndRetroactiveDivulgence",
],
)
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
conformance_test(
name = "conformance-test-append-only-oracle",
ports = [6865],
server = ":conformance-test-oracle-bin",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1",
"--index-append-only-schema",
"--mutable-contract-state-cache",
"--max-deduplication-duration=PT5S",
],
tags = [] if oracle_testing else ["manual"],
test_tool_args = [
"--verbose",
"--additional=AppendOnlyCommandDeduplicationParallelIT",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandService",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandSubmissionService",
"--additional=AppendOnlyKVCommandDeduplicationIT",
"--additional=ParticipantPruningIT",
"--additional=MultiPartySubmissionIT",
"--exclude=CommandDeduplicationIT", # It's a KV ledger so it needs the KV variant
# Disable tests targeting only multi-participant setups
"--exclude=ParticipantPruningIT:PRImmediateAndRetroactiveDivulgence",
],
)
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
conformance_test(
name = "conformance-test-oracle",
ports = [6865],
server = ":conformance-test-oracle-bin",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1",
"--max-deduplication-duration=PT5S",
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
],
tags = [] if oracle_testing else ["manual"],
test_tool_args = [
"--verbose",
"--additional=ParticipantPruningIT",
"--additional=MultiPartySubmissionIT",
"--additional=KVCommandDeduplicationIT",
Command deduplication - Participant side/committer side command deduplication conformance tests split [KVL-1093] (#10784) * Split command deduplication conformance tests into non-kv and kv tests. Because kv ledgers have both participant and committer side deduplication, the conformance tests have been duplicated into different suited which can target either both deduplications or just participant side deduplication. CommandDeduplicationIT is a default suite and should be run for ledgers with participant side only deduplication. KVCommandDeduplicationIT is optional and should be enabled for any KV ledgers. CHANGELOG_BEGIN ledger-api-test-tool - CommandDeduplicationIT tests only participant side deduplication, it should be disabled for KV ledgers. Added KVCommandDeduplicationIT which should be run for KV ledgers CHANGELOG_END * Run participant side/committer side deduplication tests based on the ledger implementation * Fix on memory build file * Daml-on-sql is not a kv ledger so revert the changes so that it runs the default command deduplication IT * Rollback compat import * Exclude command dedup from the reference test * Exclude command deduplication from the reference export * Format bazel * Set the exclude to client args for the ledger-api-test-tool and not for the ledger-on-memory * Exclude CommandDeduplicationIT from non repudiation conformance tests and include KVCommandDeduplicationIT because it runs using sandbox * Exclude HealthServiceIT from the reference-ledger-export as it has no impact on the export * Exclude CommandDeduplicationIT from the ledger-on-sql conformance-test as they are KV ledgers * Format bazel file * Exclude CommandDeduplicationIT from sandbox * Apply suggestions from code review Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com> * Add comments for command deduplication IT * Rename to be consistent with scala namings * Update formatting and comments * Add naming prefix for tests to avoid clashes Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-09-08 13:27:07 +03:00
"--exclude=CommandDeduplicationIT", # It's a KV ledger so it needs the KV variant
# Disable tests targeting only append-only schema functionality
"--exclude=ParticipantPruningIT:PRLocalAndNonLocalRetroactiveDivulgences,ParticipantPruningIT:PRRetroactiveDivulgences,ParticipantPruningIT:PRImmediateAndRetroactiveDivulgence",
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
],
)
conformance_test(
name = "conformance-test-append-only-in-memory-fan-out-postgres",
ports = [6865],
server = ":conformance-test-postgresql-bin",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1,ledger-api-transactions-buffer-max-size=10",
"--index-append-only-schema",
"--mutable-contract-state-cache",
"--buffered-ledger-api-streams-unsafe",
"--max-deduplication-duration=PT5S",
],
tags = [],
test_tool_args = [
"--verbose",
"--additional=AppendOnlyCommandDeduplicationParallelIT",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandService",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandSubmissionService",
"--additional=AppendOnlyKVCommandDeduplicationIT",
"--additional=ParticipantPruningIT",
"--additional=MultiPartySubmissionIT",
Command deduplication - Participant side/committer side command deduplication conformance tests split [KVL-1093] (#10784) * Split command deduplication conformance tests into non-kv and kv tests. Because kv ledgers have both participant and committer side deduplication, the conformance tests have been duplicated into different suited which can target either both deduplications or just participant side deduplication. CommandDeduplicationIT is a default suite and should be run for ledgers with participant side only deduplication. KVCommandDeduplicationIT is optional and should be enabled for any KV ledgers. CHANGELOG_BEGIN ledger-api-test-tool - CommandDeduplicationIT tests only participant side deduplication, it should be disabled for KV ledgers. Added KVCommandDeduplicationIT which should be run for KV ledgers CHANGELOG_END * Run participant side/committer side deduplication tests based on the ledger implementation * Fix on memory build file * Daml-on-sql is not a kv ledger so revert the changes so that it runs the default command deduplication IT * Rollback compat import * Exclude command dedup from the reference test * Exclude command deduplication from the reference export * Format bazel * Set the exclude to client args for the ledger-api-test-tool and not for the ledger-on-memory * Exclude CommandDeduplicationIT from non repudiation conformance tests and include KVCommandDeduplicationIT because it runs using sandbox * Exclude HealthServiceIT from the reference-ledger-export as it has no impact on the export * Exclude CommandDeduplicationIT from the ledger-on-sql conformance-test as they are KV ledgers * Format bazel file * Exclude CommandDeduplicationIT from sandbox * Apply suggestions from code review Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com> * Add comments for command deduplication IT * Rename to be consistent with scala namings * Update formatting and comments * Add naming prefix for tests to avoid clashes Co-authored-by: fabiotudone-da <fabio.tudone@digitalasset.com>
2021-09-08 13:27:07 +03:00
"--exclude=CommandDeduplicationIT", # It's a KV ledger so it needs the KV variant
# Disable tests targeting only multi-participant setups
"--exclude=ParticipantPruningIT:PRImmediateAndRetroactiveDivulgence",
],
)
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
conformance_test(
name = "conformance-test-append-only-in-memory-fan-out-oracle",
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
ports = [6865],
server = ":conformance-test-oracle-bin",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1,ledger-api-transactions-buffer-max-size=10",
"--index-append-only-schema",
"--mutable-contract-state-cache",
"--buffered-ledger-api-streams-unsafe",
"--max-deduplication-duration=PT5S",
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
],
tags = [] if oracle_testing else ["manual"],
test_tool_args = [
"--verbose",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandService",
"--additional=AppendOnlyCommandDeduplicationParallelIT",
"--additional=AppendOnlyCompletionDeduplicationInfoITCommandSubmissionService",
"--additional=AppendOnlyKVCommandDeduplicationIT",
"--additional=ParticipantPruningIT",
"--additional=MultiPartySubmissionIT",
"--exclude=CommandDeduplicationIT", # It's a KV ledger so it needs the KV variant
# Disable tests targeting only multi-participant setups
"--exclude=ParticipantPruningIT:PRImmediateAndRetroactiveDivulgence",
10050 append only schema on oracle (#10051) * Oracle compliant append only schema CHANGELOG_BEGIN CHANGELOG_END WIP : oracle on new appendonly schema * diff to postgres dump, create consolidated view * diff to postgres dump to ensure all oracle setup is equiv * recompute sha for changed oracle flyway scripts * drop old tables to prevent clash on name of new participant_events view * recompute sha for flyway script * prelim oracle StorageBackend * Adds support for special preparedStatement for oracle * Add support and wires to setObject by default everywhere * Add the full OracleField suite with TODOs for convenience * Wires OracleField suite to OracleFieldStrategy changelog_begin changelog_end * enable debug version of oracle driver * conversion Instant -> Timestamp for oracle * WIP: primitive println debugging * Passing PackagesSpec with appendonlyschema on Oracle Rename size column to siz to avoid reserved word clash, including migration script for postgres * include sha for new postgres migration script * add missing copyright header * cleanup * passing party spec for appendonly on oracle * passing configuration spec for appendonly on oracle * scalafmt * bazel buildifier reformat * use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat * siz instead of size for packages table on all dbs and schema * revert enabling oracle jdbc debug * Support Array[String] -> String conversion (and vice versa) for JSON array Remove as aliases for tables as this does not work with oracle Extract submitters clause for all db types Use append transaction injector for oracle append only spec * scalafmt * correct oracle failing active contract spec tests * wire in JdbcLedgerDaoCompletionsSpec * remove semi-colons for ending statements that are problematic for oracle driver * all tests up to divulgence passing for append only on oracle * all appendonly tests passing on oracle * remove ignore on fall back to limit-based query with consistent results * do not change name of size column in packages table for mutable schema for all DBs * do not change name of size column in packages table for mutable schema for all DBs * standalone oracle appendonly schema script regen shas on flyway scripts revert some cosmetic refactoring in CommonStorageBackend * Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn * Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation * Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration * Fixes queries with empty startExclusive Offsets * First draw adding Oracle conformance test suites to CI * wire in the oracle conformance tests for CI * Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2 * rename siz to package_size * recompute shas * scalafmt and include sha check for oracle append only flyway script * correct missing package_size rename * remove some todos -- correct corrupted V1__Init.sql * Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com> * correct version number for postgres rename column scripts * remove unnecessary migration tables for oracle append only * review feedback: rename createEventFilter as requested, remove todos * review feedback: case consistency * review feedback: update todos with issue markers * review feedback: cleanup * review feedback: OracleField and OracleSchema cleanup * Fixing Table generators to use preparedData for convenience * Placing TODOs for refactorings later * Renames initial append-only oracle script, for convenience * Falls back to original behavior as far prepared statements go at couple of queries Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com> Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-29 01:51:48 +03:00
],
)
conformance_test(
name = "conformance-test-contract-ids",
ports = [6865],
server = ":conformance-test-h2-memory-bin",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1",
"--jdbc-url=jdbc:h2:mem:daml-on-sql-conformance-test",
],
test_tool_args = [
"--verbose",
"--include=ContractIdIT:RejectV0,ContractIdIT:AcceptSuffixedV1,ContractIdIT:AcceptNonSuffixedV1",
],
)