2019-08-13 19:23:03 +03:00
|
|
|
# Copyright (c) 2019 The DAML Authors. All rights reserved.
|
2019-04-04 11:33:38 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
load(
|
2019-04-12 14:10:16 +03:00
|
|
|
"//bazel_tools:scala.bzl",
|
|
|
|
"da_scala_binary",
|
|
|
|
"da_scala_library",
|
|
|
|
"da_scala_test_suite",
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
|
|
|
load(
|
2019-04-12 14:10:16 +03:00
|
|
|
"//rules_daml:daml.bzl",
|
|
|
|
"daml_compile",
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
2019-10-17 14:17:21 +03:00
|
|
|
load(
|
|
|
|
"//daml-lf/language:daml-lf.bzl",
|
|
|
|
"lf_dev_version",
|
|
|
|
"lf_latest_version",
|
|
|
|
)
|
2019-04-04 11:33:38 +03:00
|
|
|
|
|
|
|
compileDependencies = [
|
2019-04-12 14:10:16 +03:00
|
|
|
# this has to come first other as somehow a different instance of grpc-core.jar
|
2019-10-28 15:53:14 +03:00
|
|
|
"@maven//:io_grpc_grpc_services",
|
2019-04-12 14:10:16 +03:00
|
|
|
"//daml-lf/data",
|
|
|
|
"//daml-lf/interface",
|
2019-05-16 03:21:09 +03:00
|
|
|
"//daml-lf/transaction",
|
2019-04-12 14:10:16 +03:00
|
|
|
"//ledger-api/rs-grpc-bridge",
|
|
|
|
"//ledger-api/rs-grpc-akka",
|
|
|
|
"//language-support/scala/bindings",
|
|
|
|
"//ledger/ledger-api-client",
|
New Ledger API test tool (#2282)
* New acceptance test tool prototype
* Fix transaction filter helper
* Address https://github.com/digital-asset/daml/pull/2282#discussion_r308081386
* Address https://github.com/digital-asset/daml/pull/2282#discussion_r308082432
Moreover, creates specific helpers for test DAML code.
* Move helpers from session to context
Remove a circular dependency between session and context, and limits the
usage of implicits.
* Run tests with ledgers out of process
* Prepare for drop in
* Temporary timeout increase
* Move bulk of the logic to the test runner
* Have a map of tests for CLI integration
* Timeout per-test, runner uses context, renaming
* Allow usage of time service, integrate semantic tests
* Integrate CLI SSL configuration
* Integrate failure expectation CLI option
* Integrate with failure output verbosity CLI option
* Integrate with test listing and picking CLI options
* Integrate with timeout scaling CLI option
* Integrate with command TTL CLI option
* Review CODEOWNERS
* Drop previously unimplemented CLI parameters
* Expand test todo list to encompass latest additions
* Deduplicate some testing infrastructure, swap in new test tool
* Remove unused rule
* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311045444
* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311051974
* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311035287
* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311055290
* WIP
* Make gRPC thread factory spawn non-deamon threads
* Remove debug prints, complete divulgence test (missing assertion messages)
* Try to detect assertion failure line number
* Add Sandbox binary that starts an ephemeral postgres instance
This allows us to use the client_server_test bazel macro to run against
the sandbox backed by postgres.
Fixes #1543
* Add Sandbox binary that starts an ephemeral postgres instance
This allows us to use the client_server_test bazel macro to run against
the sandbox backed by postgres.
Fixes #1543
* Address https://github.com/digital-asset/daml/pull/2282#discussion_r311400695
* Remove TlsConfiguration duplicate, move original to commons
* Make assertion more readable
Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>
* Fix build errors introduced in previous commit
- exclude time service tests from reference-v2
- add copyright header to TlsConfiguration
* Complete divulgence test and address review comments
Restores comments from original divulgence tests and strives to be as
close to them as possible.
- Address https://github.com/digital-asset/daml/pull/2282#discussion_r311429169
- Address https://github.com/digital-asset/daml/pull/2282#discussion_r311431156
- Address https://github.com/digital-asset/daml/pull/2282#discussion_r311431913
* Delete old divulgence tests
* Restore methods to fetch contracts by template identifier
* Run conformance tests on in-memory sandbox
* Run conformance tests on the persistent sandbox
* Remove workflow identifier workaround
* New contract keys test (#2452)
* Set channel type for LedgerSession
* Add ContractKeysIT
* Run tests against reference-server v2
* Removed the old ContractKeysIT. However, ...
... I cannot remove ContractKeysChecks completely, because we have
another test path for DARs created prior to DAML-LF 1.6, which doesn't
have the submitter == maintainer restriction for contract keys.
* Use codegen instead of custom code
* Add missing copyright headers
* Drop sandbox conformance test suite (seems to not work on Windows CI)
* Make time simpler
* Test tool tests to run only semantic tests
* Make CI behave more consistently
* Add missing files to run tests on Postrgres
* Fix flaky divulgence test, introduce readable identifiers
* Increase sandbox conformance tests timeout
* Address https://github.com/digital-asset/daml/pull/2282#discussion_r312363246
* Reintroduce test resource extraction
* Read semantic tests from the classpath rather than Bazel
* Use codegen types for ContractKeys integration test
allocateParty returns Primitive.Party and create and exercise also
accept Primitive.Party. This way we don't have to keep a String and
Primitive.Party representation around.
* Bump timeout for sandbox conformance tests
* Remove dependency on Bazel runfiles
2019-08-09 18:00:37 +03:00
|
|
|
"//ledger/ledger-api-common",
|
2019-05-24 20:18:51 +03:00
|
|
|
"//ledger/ledger-api-domain",
|
2019-07-03 19:01:46 +03:00
|
|
|
"//ledger-service/utils",
|
2019-10-10 15:18:50 +03:00
|
|
|
"//ledger-service/lf-value-json",
|
2019-10-28 15:53:14 +03:00
|
|
|
"@maven//:io_netty_netty_handler",
|
|
|
|
"@maven//:io_netty_netty_tcnative_boringssl_static",
|
|
|
|
"@maven//:com_chuusai_shapeless_2_12",
|
|
|
|
"@maven//:com_lihaoyi_fansi_2_12",
|
|
|
|
"@maven//:org_spire_math_kind_projector_2_12",
|
|
|
|
"@maven//:org_typelevel_cats_core_2_12",
|
|
|
|
"@maven//:org_typelevel_cats_effect_2_12",
|
|
|
|
"@maven//:org_typelevel_cats_free_2_12",
|
|
|
|
"@maven//:org_typelevel_cats_kernel_2_12",
|
|
|
|
"@maven//:com_github_scopt_scopt_2_12",
|
|
|
|
"@maven//:com_lihaoyi_pprint_2_12",
|
|
|
|
"@maven//:com_lihaoyi_sourcecode_2_12",
|
|
|
|
"@maven//:org_tpolecat_doobie_core_2_12",
|
|
|
|
"@maven//:org_tpolecat_doobie_free_2_12",
|
|
|
|
"@maven//:org_tpolecat_doobie_postgres_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_actor_2_12",
|
|
|
|
"@maven//:com_typesafe_akka_akka_stream_2_12",
|
|
|
|
"@maven//:org_scalaz_scalaz_core_2_12",
|
|
|
|
"@maven//:org_slf4j_slf4j_api",
|
|
|
|
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
|
|
|
|
"@maven//:io_circe_circe_core_2_12",
|
|
|
|
"@maven//:io_circe_circe_generic_2_12",
|
|
|
|
"@maven//:io_circe_circe_parser_2_12",
|
|
|
|
"@maven//:io_spray_spray_json_2_12",
|
|
|
|
"@maven//:io_grpc_grpc_netty",
|
2019-04-04 11:33:38 +03:00
|
|
|
]
|
|
|
|
|
2019-05-28 22:13:54 +03:00
|
|
|
TEST_DARS = [
|
|
|
|
"RecordsAndVariants",
|
|
|
|
"PrimitiveTypes",
|
|
|
|
"TransactionExample",
|
|
|
|
]
|
2019-04-04 11:33:38 +03:00
|
|
|
|
2019-05-28 22:13:54 +03:00
|
|
|
[
|
|
|
|
daml_compile(
|
|
|
|
name = darmod,
|
|
|
|
main_src = "src/test/resources/damls/%s.daml" % darmod,
|
2019-10-17 14:17:21 +03:00
|
|
|
# FixMe: https://github.com/digital-asset/daml/issues/2289
|
|
|
|
# change version to lf_latest_version when freezing numeric in the next language version
|
|
|
|
target = lf_dev_version,
|
2019-05-28 22:13:54 +03:00
|
|
|
)
|
|
|
|
for darmod in TEST_DARS
|
|
|
|
]
|
2019-04-04 11:33:38 +03:00
|
|
|
|
2019-06-07 18:49:30 +03:00
|
|
|
genrule(
|
|
|
|
name = "VeryLargeArchive_src",
|
|
|
|
outs = ["VeryLargeArchive/Blobs.daml"] + ["VeryLargeArchive/Blob%s.daml" % n for n in range(
|
|
|
|
1,
|
2019-06-07 22:06:33 +03:00
|
|
|
32 + 1,
|
2019-06-07 18:49:30 +03:00
|
|
|
)],
|
|
|
|
cmd =
|
|
|
|
'''
|
2019-06-07 22:06:33 +03:00
|
|
|
filecount=32
|
2019-06-07 18:49:30 +03:00
|
|
|
outs=($(OUTS))
|
|
|
|
main="$${outs[0]}"
|
|
|
|
echo 'daml 1.2
|
|
|
|
module VeryLargeArchive.Blobs where
|
2019-07-03 20:48:42 +03:00
|
|
|
import VeryLargeArchive.Blob1()' > "$$main"
|
2019-06-07 18:49:30 +03:00
|
|
|
firstfil="$${outs[1]}"
|
|
|
|
echo 'daml 1.2
|
|
|
|
module VeryLargeArchive.Blob1 where
|
|
|
|
' > "$$firstfil"
|
2019-06-07 22:06:33 +03:00
|
|
|
{ for linen in `seq 1 1024`; do
|
2019-06-07 18:49:30 +03:00
|
|
|
echo -n "x$$linen = "\\"
|
|
|
|
for charn in `seq 1 16`; do
|
|
|
|
echo -n qqqqqqqq
|
|
|
|
done;
|
|
|
|
echo \\"
|
|
|
|
done; } >> $$firstfil
|
|
|
|
for filen in `seq 2 $$filecount`; do
|
2019-07-03 20:48:42 +03:00
|
|
|
echo "import VeryLargeArchive.Blob$$filen()" >> "$$main"
|
2019-06-07 18:49:30 +03:00
|
|
|
sed -e '2s/^\\(module .*\\)1/\\1'$$filen/ "$$firstfil" > "$${outs[$$filen]}"
|
|
|
|
done
|
|
|
|
''',
|
|
|
|
)
|
|
|
|
|
|
|
|
daml_compile(
|
|
|
|
name = "VeryLargeArchive",
|
|
|
|
srcs = [":VeryLargeArchive_src"],
|
|
|
|
main_src = ":VeryLargeArchive/Blobs.daml",
|
|
|
|
)
|
|
|
|
|
2019-04-04 11:33:38 +03:00
|
|
|
testDependencies = [
|
2019-04-12 14:10:16 +03:00
|
|
|
":extractor",
|
2019-11-01 16:39:28 +03:00
|
|
|
"//bazel_tools/runfiles:scala_runfiles",
|
2019-08-01 18:10:56 +03:00
|
|
|
"//daml-lf/data-scalacheck",
|
2019-05-28 22:13:54 +03:00
|
|
|
"//daml-lf/transaction-scalacheck",
|
2019-04-12 14:10:16 +03:00
|
|
|
"//ledger/sandbox:sandbox",
|
|
|
|
"//ledger-api/testing-utils",
|
|
|
|
"//ledger/sandbox:sandbox-scala-tests-lib",
|
2019-10-28 15:53:14 +03:00
|
|
|
"@maven//:org_scalactic_scalactic_2_12",
|
|
|
|
"@maven//:org_scalacheck_scalacheck_2_12",
|
|
|
|
"@maven//:org_scalaz_scalaz_scalacheck_binding_2_12",
|
|
|
|
"@maven//:org_scalatest_scalatest_2_12",
|
|
|
|
"@maven//:org_postgresql_postgresql",
|
2019-04-04 11:33:38 +03:00
|
|
|
] + compileDependencies
|
|
|
|
|
|
|
|
da_scala_library(
|
2019-04-12 14:10:16 +03:00
|
|
|
name = "extractor",
|
|
|
|
srcs = glob(["src/main/scala/**/*.scala"]),
|
|
|
|
resources = glob(["src/main/resources/**/*"]),
|
|
|
|
runtime_deps = [
|
2019-10-28 15:53:14 +03:00
|
|
|
"@maven//:ch_qos_logback_logback_classic",
|
|
|
|
"@maven//:ch_qos_logback_logback_core",
|
2019-04-12 14:10:16 +03:00
|
|
|
],
|
|
|
|
deps = compileDependencies,
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_binary(
|
2019-04-12 14:10:16 +03:00
|
|
|
name = "extractor-binary",
|
|
|
|
main_class = "com.digitalasset.extractor.Main",
|
2019-04-12 19:30:49 +03:00
|
|
|
tags = [
|
|
|
|
"maven_coordinates=com.digitalasset:extractor:__VERSION__",
|
|
|
|
"no_scala_version_suffix",
|
|
|
|
],
|
2019-04-12 14:10:16 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
":extractor",
|
|
|
|
],
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_library(
|
2019-04-12 14:10:16 +03:00
|
|
|
name = "extractor-scala-tests-lib",
|
|
|
|
srcs = glob(["src/test/lib/**/*.scala"]),
|
|
|
|
deps = testDependencies,
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_test_suite(
|
|
|
|
name = "extractor-scala-tests",
|
2019-06-17 10:40:28 +03:00
|
|
|
size = "medium",
|
2019-04-12 14:10:16 +03:00
|
|
|
srcs = glob(["src/test/suite/**/*.scala"]),
|
2019-04-04 11:33:38 +03:00
|
|
|
data = [
|
2019-07-12 22:06:44 +03:00
|
|
|
"//daml-lf/encoder:testing-dar-latest",
|
2019-04-15 17:45:08 +03:00
|
|
|
"//extractor:PrimitiveTypes.dar",
|
|
|
|
"//extractor:RecordsAndVariants.dar",
|
|
|
|
"//extractor:TransactionExample.dar",
|
2019-06-07 18:49:30 +03:00
|
|
|
"//extractor:VeryLargeArchive.dar",
|
2019-06-17 10:40:28 +03:00
|
|
|
"@postgresql_dev_env//:all",
|
|
|
|
"@postgresql_dev_env//:createdb",
|
|
|
|
"@postgresql_dev_env//:initdb",
|
|
|
|
"@postgresql_dev_env//:pg_ctl",
|
2019-04-04 11:33:38 +03:00
|
|
|
],
|
2019-04-12 14:10:16 +03:00
|
|
|
resources = glob(["src/test/resources/**/*"]),
|
2019-04-04 11:33:38 +03:00
|
|
|
deps = [
|
2019-04-12 14:10:16 +03:00
|
|
|
":extractor-scala-tests-lib",
|
2019-04-04 11:33:38 +03:00
|
|
|
] + testDependencies,
|
|
|
|
)
|