2023-01-04 20:21:15 +03:00
|
|
|
# Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2019-05-09 12:10:54 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
load(
|
|
|
|
"//bazel_tools:scala.bzl",
|
|
|
|
"da_scala_library",
|
|
|
|
)
|
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
|
|
|
load(
|
|
|
|
"//language-support/scala/codegen:codegen.bzl",
|
|
|
|
"dar_to_scala",
|
|
|
|
)
|
2021-01-14 00:23:31 +03:00
|
|
|
load("@scala_version//:index.bzl", "scala_major_version")
|
2021-02-22 13:41:19 +03:00
|
|
|
load("@scala_version//:index.bzl", "scala_major_version")
|
2021-02-23 11:19:17 +03:00
|
|
|
load(
|
|
|
|
"//daml-lf/language:daml-lf.bzl",
|
2021-08-02 20:43:37 +03:00
|
|
|
"lf_version_configuration",
|
|
|
|
"lf_version_configuration_versions",
|
2022-08-30 10:20:22 +03:00
|
|
|
"versions",
|
2021-02-23 11:19:17 +03:00
|
|
|
)
|
2023-03-02 20:04:45 +03:00
|
|
|
load("//ledger-test-tool/ledger-api-tests:conformance.bzl", "testtool_lf_versions")
|
2023-02-14 18:29:13 +03:00
|
|
|
load("//test-common:test-common.bzl", "da_scala_dar_resources_library")
|
2021-02-22 13:41:19 +03:00
|
|
|
|
|
|
|
alias(
|
|
|
|
name = "dar-files",
|
2021-07-27 10:27:03 +03:00
|
|
|
actual = "dar-files-default",
|
2021-02-22 13:41:19 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2019-08-22 14:32:41 +03:00
|
|
|
|
2021-02-22 13:41:19 +03:00
|
|
|
[
|
|
|
|
[
|
|
|
|
# alias model-tests-KEYWORD.dar, dar-files-KEYWORD, and dar-files-KEYWORD-lib
|
2021-03-19 18:29:02 +03:00
|
|
|
# to model-tests-TAG.dar, dar-files-TAG, dar-files-TAG-lib, and test-common-TAG
|
2021-07-27 10:27:03 +03:00
|
|
|
# where : KEYWORD is a keyword like default, latest, or dev
|
2021-02-22 13:41:19 +03:00
|
|
|
# TAG is a (java friendly) version TAG like 1_8
|
|
|
|
# The mapping KEYWORD -> TAG is defined by test_common_configurations
|
|
|
|
alias(
|
|
|
|
name = "%s-%s%s" % (target_prefix, name, target_suffix),
|
2021-02-23 11:19:17 +03:00
|
|
|
actual = ":%s-%s%s" % (target_prefix, lf_version, target_suffix),
|
2021-02-22 13:41:19 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
),
|
|
|
|
]
|
|
|
|
for (target_prefix, target_suffix) in [
|
2022-06-21 11:38:15 +03:00
|
|
|
("benchtool-tests", ".dar"),
|
2021-02-22 13:41:19 +03:00
|
|
|
("model-tests", ".dar"),
|
|
|
|
("dar-files", ""),
|
|
|
|
("dar-files", "-lib"),
|
2021-03-19 18:29:02 +03:00
|
|
|
("test-common", ""),
|
2021-02-22 13:41:19 +03:00
|
|
|
]
|
2021-02-23 11:19:17 +03:00
|
|
|
for (name, lf_version) in lf_version_configuration.items()
|
2021-02-05 19:53:31 +03:00
|
|
|
]
|
|
|
|
|
2021-03-19 18:29:02 +03:00
|
|
|
alias(
|
2019-05-09 12:10:54 +03:00
|
|
|
name = "test-common",
|
2021-07-27 10:27:03 +03:00
|
|
|
actual = "test-common-default",
|
2021-03-19 18:29:02 +03:00
|
|
|
visibility = ["//visibility:public"],
|
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
|
|
|
)
|
|
|
|
|
2019-08-22 14:32:41 +03:00
|
|
|
[
|
|
|
|
[
|
|
|
|
da_scala_library(
|
2021-03-19 18:29:02 +03:00
|
|
|
name = "test-common-%s" % target,
|
|
|
|
srcs = glob(["src/main/scala/**/*.scala"]),
|
2021-12-08 11:54:49 +03:00
|
|
|
scala_deps = [
|
|
|
|
"@maven//:org_scalatest_scalatest_shouldmatchers",
|
|
|
|
"@maven//:org_scalatest_scalatest_core",
|
|
|
|
"@maven//:org_scalactic_scalactic",
|
|
|
|
"@maven//:org_scalatest_scalatest_matchers_core",
|
|
|
|
],
|
2021-03-19 18:29:02 +03:00
|
|
|
tags = ["maven_coordinates=com.daml:test-common-%s:__VERSION__" % target],
|
|
|
|
visibility = [
|
|
|
|
"//visibility:public",
|
2021-02-15 11:06:40 +03:00
|
|
|
],
|
2021-01-08 09:22:38 +03:00
|
|
|
deps = [
|
2021-03-19 18:29:02 +03:00
|
|
|
"//ledger-api/grpc-definitions:ledger_api_proto_scala",
|
2021-12-08 11:54:49 +03:00
|
|
|
"//libs-scala/scala-utils",
|
2021-03-19 18:29:02 +03:00
|
|
|
"//libs-scala/timer-utils",
|
|
|
|
"@maven//:ch_qos_logback_logback_classic",
|
|
|
|
"@maven//:ch_qos_logback_logback_core",
|
|
|
|
"@maven//:io_grpc_grpc_context",
|
2021-12-08 11:54:49 +03:00
|
|
|
"@maven//:org_scalatest_scalatest_compatible",
|
2021-09-15 08:43:32 +03:00
|
|
|
"@maven//:org_slf4j_slf4j_api",
|
2021-02-15 11:06:40 +03:00
|
|
|
],
|
|
|
|
),
|
2019-08-22 14:32:41 +03:00
|
|
|
]
|
2023-02-06 10:58:47 +03:00
|
|
|
for target in testtool_lf_versions
|
2019-08-22 14:32:41 +03:00
|
|
|
]
|
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
|
|
|
|
2022-08-22 19:59:03 +03:00
|
|
|
# Carbon tests helps to test upgrades when packages are dependent on each other
|
|
|
|
carbon_test_names = [
|
|
|
|
"carbonv1",
|
|
|
|
"carbonv2", #carbonv2 depends on carbon v1
|
2022-08-25 15:32:10 +03:00
|
|
|
"carbonv3", #carbonv3 depends on carbon v2
|
2022-09-27 15:30:47 +03:00
|
|
|
"modelext", #modelext depends on model
|
2022-08-22 19:59:03 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
general_test_names = [
|
2022-06-21 11:38:15 +03:00
|
|
|
"benchtool",
|
2022-01-24 18:01:35 +03:00
|
|
|
"model",
|
|
|
|
"semantic",
|
|
|
|
"performance",
|
|
|
|
"package_management",
|
|
|
|
]
|
2021-03-19 18:29:02 +03:00
|
|
|
|
2022-08-22 19:59:03 +03:00
|
|
|
# Correspond to the directories under src/test/lib/daml
|
|
|
|
test_names = {
|
2022-08-30 10:20:22 +03:00
|
|
|
lf_version: general_test_names + (carbon_test_names if versions.gte(lf_version, "1.15") else [])
|
2023-02-06 10:58:47 +03:00
|
|
|
for lf_version in testtool_lf_versions
|
2022-08-22 19:59:03 +03:00
|
|
|
}
|
|
|
|
|
2021-03-19 18:29:02 +03:00
|
|
|
da_scala_dar_resources_library(
|
|
|
|
add_maven_tag = True,
|
2022-01-24 18:01:35 +03:00
|
|
|
daml_dir_names = test_names,
|
2021-03-19 18:29:02 +03:00
|
|
|
daml_root_dir = "src/main/daml",
|
2022-08-22 19:59:03 +03:00
|
|
|
data_dependencies = {
|
2023-02-14 18:29:13 +03:00
|
|
|
"carbonv2": ["//test-common:carbonv1-tests-%s.build"],
|
|
|
|
"carbonv3": ["//test-common:carbonv2-tests-%s.build"],
|
|
|
|
"modelext": ["//test-common:model-tests-%s.build"],
|
2022-08-22 19:59:03 +03:00
|
|
|
},
|
2021-12-20 21:31:06 +03:00
|
|
|
enable_scenarios = True,
|
2021-12-07 09:06:12 +03:00
|
|
|
exclusions = {
|
2022-05-18 15:58:45 +03:00
|
|
|
"1.8": [
|
|
|
|
"**/*Exception*.daml",
|
|
|
|
"**/*Interface*daml",
|
2022-05-19 20:13:28 +03:00
|
|
|
"**/Limits.daml",
|
2022-05-26 20:45:16 +03:00
|
|
|
"**/Foo.daml",
|
2022-05-18 15:58:45 +03:00
|
|
|
],
|
|
|
|
"1.14": [
|
|
|
|
"**/*Interface*daml",
|
|
|
|
],
|
2021-12-07 09:06:12 +03:00
|
|
|
},
|
2023-02-06 10:58:47 +03:00
|
|
|
lf_versions = testtool_lf_versions,
|
2021-03-19 18:29:02 +03:00
|
|
|
maven_name_prefix = "test",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2021-02-05 19:53:31 +03:00
|
|
|
[
|
|
|
|
[
|
2021-03-19 18:29:02 +03:00
|
|
|
[
|
|
|
|
dar_to_scala(
|
|
|
|
name = "%s-tests-%s.scala-codegen" % (test_name, target),
|
|
|
|
srcs = [":%s-tests-%s.dar" % (test_name, target)],
|
|
|
|
package_prefix = "com.daml.ledger.test.%s" % test_name,
|
|
|
|
srcjar_out = "%s-%s.scala.srcjar" % (test_name, target),
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
),
|
|
|
|
da_scala_library(
|
|
|
|
name = "%s-tests-%s.scala" % (test_name, target),
|
|
|
|
srcs = [
|
|
|
|
":%s-tests-%s.scala-codegen" % (test_name, target),
|
|
|
|
],
|
|
|
|
scalacopts = [
|
2022-02-10 16:25:23 +03:00
|
|
|
"-Wconf:cat=unused-imports&site=com\\.daml\\.ledger\\.test\\.%s\\..*:s" % test_name,
|
2021-03-19 18:29:02 +03:00
|
|
|
],
|
2022-02-10 16:25:23 +03:00
|
|
|
tags = ["maven_coordinates=com.daml:test-common-%s-tests-scala-%s:__VERSION__" % (
|
|
|
|
test_name.replace("_", "-"),
|
|
|
|
target,
|
|
|
|
)],
|
2021-03-19 18:29:02 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"//language-support/scala/bindings",
|
|
|
|
],
|
|
|
|
),
|
|
|
|
]
|
2022-08-22 19:59:03 +03:00
|
|
|
for test_name in test_names.get(target, [])
|
2021-02-05 19:53:31 +03:00
|
|
|
]
|
2023-02-06 10:58:47 +03:00
|
|
|
for target in testtool_lf_versions
|
2021-02-05 19:53:31 +03:00
|
|
|
]
|