mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-11 04:45:57 +03:00
Switch to an environment variable for enabling Oracle tests. (#9511)
* participant-integration-api: Build Oracle tests, but don't run them. CHANGELOG_BEGIN CHANGELOG_END * triggers: Switch to an environment variable for enabling Oracle tests. * http-json: Switch to an environment variable for enabling Oracle tests. * Disable running Oracle tests by default, not building them. * triggers/service: Remove unused test dependencies.
This commit is contained in:
parent
e39c20ecbc
commit
8cd3658b14
19
BUILD
19
BUILD
@ -271,22 +271,3 @@ da_haskell_repl(
|
||||
"//language-support/ts/codegen:daml2js",
|
||||
],
|
||||
)
|
||||
|
||||
string_flag(
|
||||
name = "oracle_testing",
|
||||
build_setting_default = "no",
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "oracle_available",
|
||||
flag_values = {
|
||||
":oracle_testing": "yes",
|
||||
},
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "oracle_unavailable",
|
||||
flag_values = {
|
||||
":oracle_testing": "no",
|
||||
},
|
||||
)
|
||||
|
@ -56,6 +56,10 @@ load("//bazel_tools:build_environment.bzl", "build_environment")
|
||||
|
||||
build_environment(name = "build_environment")
|
||||
|
||||
load("//bazel_tools:oracle.bzl", "oracle_configure")
|
||||
|
||||
oracle_configure(name = "oracle")
|
||||
|
||||
load("//bazel_tools:scala_version.bzl", "scala_version_configure")
|
||||
|
||||
scala_version_configure(name = "scala_version")
|
||||
|
28
bazel_tools/oracle.bzl
Normal file
28
bazel_tools/oracle.bzl
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
def _impl(ctx):
|
||||
# Generates an empty BUILD file, because we do not need to build anything.
|
||||
ctx.file(
|
||||
"BUILD",
|
||||
content = """exports_files(["index.bzl"])""",
|
||||
executable = False,
|
||||
)
|
||||
|
||||
testing = ctx.os.environ.get("DAML_ORACLE_TESTING", default = "false") == "true"
|
||||
|
||||
ctx.file(
|
||||
"index.bzl",
|
||||
content = """
|
||||
oracle_testing = {testing}
|
||||
""".format(
|
||||
testing = testing,
|
||||
),
|
||||
executable = False,
|
||||
)
|
||||
|
||||
oracle_configure = repository_rule(
|
||||
environ = ["DAML_ORACLE_TESTING"],
|
||||
implementation = _impl,
|
||||
attrs = {},
|
||||
)
|
@ -238,7 +238,7 @@ jobs:
|
||||
sleep 1
|
||||
done
|
||||
# Actually run some tests
|
||||
bazel test --//:oracle_testing=yes \
|
||||
DAML_ORACLE_TESTING=true bazel test \
|
||||
--test_env ORACLE_USERNAME=system --test_env ORACLE_PORT --test_env ORACLE_PWD \
|
||||
//ledger-service/http-json-oracle/... \
|
||||
//triggers/service:test-oracle \
|
||||
|
@ -1,6 +1,8 @@
|
||||
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
load("@oracle//:index.bzl", "oracle_testing")
|
||||
load("@scala_version//:index.bzl", "scala_version_suffix")
|
||||
load(
|
||||
"//bazel_tools:scala.bzl",
|
||||
"da_scala_binary",
|
||||
@ -8,7 +10,6 @@ load(
|
||||
"da_scala_test",
|
||||
"lf_scalacopts",
|
||||
)
|
||||
load("@scala_version//:index.bzl", "scala_version_suffix")
|
||||
|
||||
hj_scalacopts = lf_scalacopts + [
|
||||
"-P:wartremover:traverser:org.wartremover.warts.NonUnitStatements",
|
||||
@ -37,10 +38,7 @@ da_scala_test(
|
||||
"@maven//:org_scalaz_scalaz_core",
|
||||
],
|
||||
scalacopts = hj_scalacopts,
|
||||
target_compatible_with = select({
|
||||
"//:oracle_available": [],
|
||||
"//conditions:default": ["@platforms//:incompatible"],
|
||||
}),
|
||||
tags = [] if oracle_testing else ["manual"],
|
||||
runtime_deps = [
|
||||
"@maven//:com_oracle_database_jdbc_ojdbc8",
|
||||
],
|
||||
|
@ -1,18 +1,20 @@
|
||||
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
load("@oracle//:index.bzl", "oracle_testing")
|
||||
load("@os_info//:os_info.bzl", "is_windows")
|
||||
load("//rules_daml:daml.bzl", "daml_compile")
|
||||
load("@scala_version//:index.bzl", "scala_major_version_suffix")
|
||||
load(
|
||||
"//bazel_tools:scala.bzl",
|
||||
"da_scala_binary",
|
||||
"da_scala_library",
|
||||
"da_scala_test",
|
||||
"da_scala_test_suite",
|
||||
"scaladoc_jar",
|
||||
"silencer_plugin",
|
||||
)
|
||||
load("//bazel_tools:pom_file.bzl", "pom_file")
|
||||
load("@scala_version//:index.bzl", "scala_major_version_suffix")
|
||||
load("//rules_daml:daml.bzl", "daml_compile")
|
||||
|
||||
compile_deps = [
|
||||
"//daml-lf/archive:daml_lf_archive_reader",
|
||||
@ -200,80 +202,6 @@ da_scala_library(
|
||||
],
|
||||
)
|
||||
|
||||
test_deps = [
|
||||
":participant-integration-api",
|
||||
":participant-integration-api-tests-lib",
|
||||
"//bazel_tools/runfiles:scala_runfiles",
|
||||
"//daml-lf/archive:daml_lf_archive_reader",
|
||||
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
|
||||
"//daml-lf/data",
|
||||
"//daml-lf/engine",
|
||||
"//daml-lf/interpreter",
|
||||
"//daml-lf/language",
|
||||
"//daml-lf/transaction",
|
||||
"//daml-lf/transaction:value_proto_java",
|
||||
"//daml-lf/transaction-test-lib",
|
||||
"//language-support/scala/bindings",
|
||||
"//ledger-api/rs-grpc-akka",
|
||||
"//ledger-api/rs-grpc-akka:rs-grpc-akka-tests-lib",
|
||||
"//ledger-api/rs-grpc-bridge",
|
||||
"//ledger-api/sample-service",
|
||||
"//ledger-api/testing-utils",
|
||||
"//ledger/caching",
|
||||
"//ledger/ledger-api-auth",
|
||||
"//ledger/ledger-api-client",
|
||||
"//ledger/ledger-api-common",
|
||||
"//ledger/ledger-api-common:ledger-api-common-scala-tests-lib",
|
||||
"//ledger/ledger-api-domain",
|
||||
"//ledger/ledger-api-health",
|
||||
"//ledger/ledger-resources",
|
||||
"//ledger/ledger-resources:ledger-resources-test-lib",
|
||||
"//ledger/metrics",
|
||||
"//ledger/participant-state",
|
||||
"//ledger/participant-state-index",
|
||||
"//ledger/test-common",
|
||||
"//ledger/test-common:dar-files-stable-lib",
|
||||
"//libs-scala/contextualized-logging",
|
||||
"//libs-scala/concurrent",
|
||||
"//libs-scala/grpc-utils",
|
||||
"//libs-scala/ports",
|
||||
"//libs-scala/oracle-testing",
|
||||
"//libs-scala/postgresql-testing",
|
||||
"//libs-scala/resources",
|
||||
"//libs-scala/resources-akka",
|
||||
"//libs-scala/resources-grpc",
|
||||
"//libs-scala/timer-utils",
|
||||
"@maven//:ch_qos_logback_logback_classic",
|
||||
"@maven//:ch_qos_logback_logback_core",
|
||||
"@maven//:commons_io_commons_io",
|
||||
"@maven//:com_github_ben_manes_caffeine_caffeine",
|
||||
"@maven//:io_dropwizard_metrics_metrics_core",
|
||||
"@maven//:io_grpc_grpc_netty",
|
||||
"@maven//:io_grpc_grpc_services",
|
||||
"@maven//:io_netty_netty_common",
|
||||
"@maven//:io_netty_netty_handler",
|
||||
"@maven//:io_netty_netty_transport",
|
||||
"@maven//:org_awaitility_awaitility",
|
||||
"@maven//:org_flywaydb_flyway_core",
|
||||
"@maven//:org_mockito_mockito_core",
|
||||
"@maven//:org_reactivestreams_reactive_streams",
|
||||
"@maven//:org_slf4j_slf4j_api",
|
||||
"@maven//:com_zaxxer_HikariCP",
|
||||
]
|
||||
|
||||
scala_test_deps = [
|
||||
"@maven//:com_typesafe_akka_akka_actor",
|
||||
"@maven//:com_typesafe_akka_akka_stream",
|
||||
"@maven//:com_typesafe_akka_akka_stream_testkit",
|
||||
"@maven//:com_typesafe_akka_akka_testkit",
|
||||
"@maven//:org_mockito_mockito_scala",
|
||||
"@maven//:org_scalacheck_scalacheck",
|
||||
"@maven//:org_scalactic_scalactic",
|
||||
"@maven//:org_scalatest_scalatest",
|
||||
"@maven//:org_scalatestplus_scalacheck_1_14",
|
||||
"@maven//:org_scalaz_scalaz_core",
|
||||
]
|
||||
|
||||
openssl_executable = "@openssl_dev_env//:bin/openssl" if not is_windows else "@openssl_dev_env//:usr/bin/openssl.exe"
|
||||
|
||||
da_scala_test_suite(
|
||||
@ -295,11 +223,73 @@ da_scala_test_suite(
|
||||
"-Djava.security.debug=\"certpath ocsp\"", # This facilitates debugging of the OCSP checks mechanism
|
||||
],
|
||||
resources = glob(["src/test/resources/**/*"]),
|
||||
scala_deps = scala_test_deps,
|
||||
deps = test_deps,
|
||||
scala_deps = [
|
||||
"@maven//:com_typesafe_akka_akka_actor",
|
||||
"@maven//:com_typesafe_akka_akka_stream",
|
||||
"@maven//:com_typesafe_akka_akka_stream_testkit",
|
||||
"@maven//:org_mockito_mockito_scala",
|
||||
"@maven//:org_scalacheck_scalacheck",
|
||||
"@maven//:org_scalactic_scalactic",
|
||||
"@maven//:org_scalatest_scalatest",
|
||||
"@maven//:org_scalatestplus_scalacheck_1_14",
|
||||
"@maven//:org_scalaz_scalaz_core",
|
||||
],
|
||||
deps = [
|
||||
":participant-integration-api",
|
||||
":participant-integration-api-tests-lib",
|
||||
"//bazel_tools/runfiles:scala_runfiles",
|
||||
"//daml-lf/archive:daml_lf_archive_reader",
|
||||
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
|
||||
"//daml-lf/data",
|
||||
"//daml-lf/engine",
|
||||
"//daml-lf/language",
|
||||
"//daml-lf/transaction",
|
||||
"//daml-lf/transaction:value_proto_java",
|
||||
"//daml-lf/transaction-test-lib",
|
||||
"//language-support/scala/bindings",
|
||||
"//ledger-api/rs-grpc-akka",
|
||||
"//ledger-api/rs-grpc-akka:rs-grpc-akka-tests-lib",
|
||||
"//ledger-api/rs-grpc-bridge",
|
||||
"//ledger-api/sample-service",
|
||||
"//ledger-api/testing-utils",
|
||||
"//ledger/caching",
|
||||
"//ledger/ledger-api-client",
|
||||
"//ledger/ledger-api-common",
|
||||
"//ledger/ledger-api-common:ledger-api-common-scala-tests-lib",
|
||||
"//ledger/ledger-api-domain",
|
||||
"//ledger/ledger-api-health",
|
||||
"//ledger/ledger-resources",
|
||||
"//ledger/ledger-resources:ledger-resources-test-lib",
|
||||
"//ledger/metrics",
|
||||
"//ledger/participant-state",
|
||||
"//ledger/participant-state-index",
|
||||
"//ledger/test-common",
|
||||
"//ledger/test-common:dar-files-stable-lib",
|
||||
"//libs-scala/concurrent",
|
||||
"//libs-scala/contextualized-logging",
|
||||
"//libs-scala/grpc-utils",
|
||||
"//libs-scala/ports",
|
||||
"//libs-scala/postgresql-testing",
|
||||
"//libs-scala/resources",
|
||||
"//libs-scala/resources-akka",
|
||||
"//libs-scala/resources-grpc",
|
||||
"@maven//:ch_qos_logback_logback_classic",
|
||||
"@maven//:com_github_ben_manes_caffeine_caffeine",
|
||||
"@maven//:com_zaxxer_HikariCP",
|
||||
"@maven//:commons_io_commons_io",
|
||||
"@maven//:io_dropwizard_metrics_metrics_core",
|
||||
"@maven//:io_grpc_grpc_netty",
|
||||
"@maven//:io_netty_netty_handler",
|
||||
"@maven//:io_netty_netty_transport",
|
||||
"@maven//:org_flywaydb_flyway_core",
|
||||
"@maven//:org_mockito_mockito_core",
|
||||
"@maven//:org_reactivestreams_reactive_streams",
|
||||
"@maven//:org_slf4j_slf4j_api",
|
||||
],
|
||||
)
|
||||
|
||||
da_scala_test_suite(
|
||||
# The "manual" test tag doesn't seem to work with `da_scala_test_suite`.
|
||||
da_scala_test(
|
||||
name = "participant-integration-api-tests-oracle",
|
||||
size = "large",
|
||||
srcs = glob(["src/test/suite/**/*Oracle*.scala"]),
|
||||
@ -312,15 +302,40 @@ da_scala_test_suite(
|
||||
"-Djava.security.debug=\"certpath ocsp\"", # This facilitates debugging of the OCSP checks mechanism
|
||||
],
|
||||
resources = glob(["src/test/resources/**/*"]),
|
||||
scala_deps = scala_test_deps,
|
||||
target_compatible_with = select({
|
||||
"//:oracle_available": [],
|
||||
"//conditions:default": ["@platforms//:incompatible"],
|
||||
}),
|
||||
scala_deps = [
|
||||
"@maven//:com_typesafe_akka_akka_actor",
|
||||
"@maven//:com_typesafe_akka_akka_stream",
|
||||
"@maven//:org_scalacheck_scalacheck",
|
||||
"@maven//:org_scalactic_scalactic",
|
||||
"@maven//:org_scalatest_scalatest",
|
||||
],
|
||||
tags = [] if oracle_testing else ["manual"],
|
||||
runtime_deps = [
|
||||
"@maven//:com_oracle_database_jdbc_ojdbc8",
|
||||
],
|
||||
deps = test_deps,
|
||||
deps = [
|
||||
":participant-integration-api",
|
||||
":participant-integration-api-tests-lib",
|
||||
"//daml-lf/archive:daml_lf_archive_reader",
|
||||
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
|
||||
"//daml-lf/data",
|
||||
"//daml-lf/transaction",
|
||||
"//daml-lf/transaction-test-lib",
|
||||
"//language-support/scala/bindings",
|
||||
"//ledger-api/rs-grpc-bridge",
|
||||
"//ledger-api/testing-utils",
|
||||
"//ledger/ledger-api-common",
|
||||
"//ledger/ledger-api-domain",
|
||||
"//ledger/ledger-api-health",
|
||||
"//ledger/ledger-resources",
|
||||
"//ledger/participant-state",
|
||||
"//ledger/participant-state-index",
|
||||
"//libs-scala/contextualized-logging",
|
||||
"//libs-scala/oracle-testing",
|
||||
"//libs-scala/ports",
|
||||
"//libs-scala/resources",
|
||||
"@maven//:org_slf4j_slf4j_api",
|
||||
],
|
||||
)
|
||||
|
||||
exports_files(["src/main/resources/logback.xml"])
|
||||
|
@ -1,6 +1,9 @@
|
||||
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
load("@oracle//:index.bzl", "oracle_testing")
|
||||
load("@build_environment//:configuration.bzl", "sdk_version")
|
||||
load("@os_info//:os_info.bzl", "is_windows")
|
||||
load(
|
||||
"//bazel_tools:scala.bzl",
|
||||
"da_scala_binary",
|
||||
@ -8,8 +11,6 @@ load(
|
||||
"da_scala_test",
|
||||
"da_scala_test_suite",
|
||||
)
|
||||
load("@build_environment//:configuration.bzl", "sdk_version")
|
||||
load("@os_info//:os_info.bzl", "is_windows")
|
||||
|
||||
tsvc_main_scalacopts = [
|
||||
"-P:wartremover:traverser:org.wartremover.warts.%s" % wart
|
||||
@ -194,63 +195,82 @@ da_scala_library(
|
||||
],
|
||||
)
|
||||
|
||||
test_deps = [
|
||||
":trigger-service",
|
||||
"//ledger-api/testing-utils",
|
||||
"//ledger-api/rs-grpc-bridge",
|
||||
":trigger-service-tests",
|
||||
"//daml-lf/archive:daml_lf_archive_reader",
|
||||
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
|
||||
"//daml-lf/data",
|
||||
"//language-support/scala/bindings-akka",
|
||||
"//ledger-service/jwt",
|
||||
"//ledger/ledger-api-auth",
|
||||
"//ledger/ledger-api-common",
|
||||
"//ledger/ledger-resources",
|
||||
"//ledger/sandbox-classic",
|
||||
"//ledger/sandbox-common",
|
||||
"//libs-scala/adjustable-clock",
|
||||
"//libs-scala/flyway-testing",
|
||||
"//libs-scala/oracle-testing",
|
||||
"//libs-scala/ports",
|
||||
"//libs-scala/postgresql-testing",
|
||||
"//libs-scala/resources",
|
||||
"//triggers/service/auth:oauth2-test-server",
|
||||
"@maven//:eu_rekawek_toxiproxy_toxiproxy_java_2_1_3",
|
||||
"@maven//:org_flywaydb_flyway_core",
|
||||
"//ledger-service/cli-opts",
|
||||
]
|
||||
|
||||
scala_test_deps = [
|
||||
"@maven//:io_spray_spray_json",
|
||||
"@maven//:com_typesafe_akka_akka_http_core",
|
||||
"@maven//:org_scalatest_scalatest",
|
||||
"@maven//:org_scalaz_scalaz_core",
|
||||
"@maven//:com_github_scopt_scopt",
|
||||
]
|
||||
|
||||
da_scala_test_suite(
|
||||
name = "test",
|
||||
srcs = glob(
|
||||
["src/test-suite/scala/**/*.scala"],
|
||||
exclude = ["**/*Oracle*"],
|
||||
),
|
||||
scala_deps = scala_test_deps,
|
||||
deps = test_deps,
|
||||
scala_deps = [
|
||||
"@maven//:io_spray_spray_json",
|
||||
"@maven//:com_typesafe_akka_akka_http_core",
|
||||
"@maven//:org_scalatest_scalatest",
|
||||
"@maven//:org_scalaz_scalaz_core",
|
||||
"@maven//:com_github_scopt_scopt",
|
||||
],
|
||||
deps = [
|
||||
":trigger-service",
|
||||
":trigger-service-tests",
|
||||
"//daml-lf/archive:daml_lf_archive_reader",
|
||||
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
|
||||
"//daml-lf/data",
|
||||
"//language-support/scala/bindings-akka",
|
||||
"//ledger-api/rs-grpc-bridge",
|
||||
"//ledger-api/testing-utils",
|
||||
"//ledger-service/cli-opts",
|
||||
"//ledger-service/jwt",
|
||||
"//ledger/ledger-api-auth",
|
||||
"//ledger/ledger-api-common",
|
||||
"//ledger/ledger-resources",
|
||||
"//ledger/sandbox-classic",
|
||||
"//ledger/sandbox-common",
|
||||
"//libs-scala/adjustable-clock",
|
||||
"//libs-scala/flyway-testing",
|
||||
"//libs-scala/ports",
|
||||
"//libs-scala/postgresql-testing",
|
||||
"//libs-scala/resources",
|
||||
"//triggers/service/auth:oauth2-test-server",
|
||||
"@maven//:eu_rekawek_toxiproxy_toxiproxy_java_2_1_3",
|
||||
"@maven//:org_flywaydb_flyway_core",
|
||||
],
|
||||
)
|
||||
|
||||
da_scala_test_suite(
|
||||
# The "manual" test tag doesn't seem to work with `da_scala_test_suite`.
|
||||
da_scala_test(
|
||||
name = "test-oracle",
|
||||
srcs = glob(["src/test-suite/scala/**/*Oracle*.scala"]),
|
||||
scala_deps = scala_test_deps,
|
||||
target_compatible_with = select({
|
||||
"//:oracle_available": [],
|
||||
"//conditions:default": ["@platforms//:incompatible"],
|
||||
}),
|
||||
scala_deps = [
|
||||
"@maven//:io_spray_spray_json",
|
||||
"@maven//:com_typesafe_akka_akka_http_core",
|
||||
"@maven//:org_scalatest_scalatest",
|
||||
"@maven//:org_scalaz_scalaz_core",
|
||||
],
|
||||
tags = [] if oracle_testing else ["manual"],
|
||||
runtime_deps = [
|
||||
"@maven//:com_oracle_database_jdbc_ojdbc8",
|
||||
],
|
||||
deps = test_deps,
|
||||
deps = [
|
||||
":trigger-service",
|
||||
":trigger-service-tests",
|
||||
"//daml-lf/archive:daml_lf_archive_reader",
|
||||
"//daml-lf/archive:daml_lf_dev_archive_proto_java",
|
||||
"//daml-lf/data",
|
||||
"//language-support/scala/bindings-akka",
|
||||
"//ledger-api/rs-grpc-bridge",
|
||||
"//ledger-api/testing-utils",
|
||||
"//ledger-service/jwt",
|
||||
"//ledger/ledger-api-auth",
|
||||
"//ledger/ledger-api-common",
|
||||
"//ledger/ledger-resources",
|
||||
"//ledger/sandbox-classic",
|
||||
"//ledger/sandbox-common",
|
||||
"//libs-scala/adjustable-clock",
|
||||
"//libs-scala/oracle-testing",
|
||||
"//libs-scala/ports",
|
||||
"//libs-scala/resources",
|
||||
"//triggers/service/auth:oauth2-test-server",
|
||||
"@maven//:eu_rekawek_toxiproxy_toxiproxy_java_2_1_3",
|
||||
],
|
||||
)
|
||||
|
||||
genrule(
|
||||
|
Loading…
Reference in New Issue
Block a user