parallelize long-running custom/user token tests (#13290)

Saves about 90 seconds in test wallclock time. Other tests considered
either ran too short to bother splitting, or were Oracle and thus won't
affect the main run at all.

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Stephen Compall 2022-03-15 10:59:36 -04:00 committed by GitHub
parent 1feb4d25eb
commit 153a5e6bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 90 additions and 10 deletions

View File

@ -488,7 +488,70 @@ test_suite(
)
[
da_scala_test(
da_scala_library(
name = "failure-tests-lib-{}".format(edition),
srcs = glob(["src/failurelib/scala/**/*.scala"]),
plugins = [
kind_projector_plugin,
],
scala_deps = [
"@maven//:com_typesafe_akka_akka_http_core",
"@maven//:com_typesafe_scala_logging_scala_logging",
"@maven//:io_spray_spray_json",
"@maven//:org_scalactic_scalactic",
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_freespec",
"@maven//:org_scalatest_scalatest_matchers_core",
"@maven//:org_scalatest_scalatest_shouldmatchers",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_typelevel_cats_core",
"@maven//:org_typelevel_cats_effect",
],
scalacopts = hj_scalacopts,
deps = [
":http-json-{}".format(edition),
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/data",
"//language-support/scala/bindings-akka",
"//ledger-api/rs-grpc-bridge",
"//ledger-api/testing-utils",
"//ledger-service/fetch-contracts",
"//ledger/ledger-configuration",
"//libs-scala/contextualized-logging",
"//ledger-service/http-json-cli:{}".format(edition),
"//ledger-service/http-json-testing:{}".format(edition),
"//ledger-service/jwt",
"//ledger-service/utils",
"//ledger/caching",
"//ledger/ledger-api-auth",
"//ledger/ledger-api-common",
"//ledger/ledger-resources",
"//ledger/metrics",
"//ledger/participant-integration-api",
"//ledger/participant-integration-api:participant-integration-api-tests-lib",
"//ledger/sandbox-common",
"//ledger/sandbox-common:sandbox-common-scala-tests-lib",
"//ledger/sandbox-on-x:sandbox-classic-server",
"//libs-scala/db-utils",
"//libs-scala/ports",
"//libs-scala/ports:ports-testing",
"//libs-scala/postgresql-testing",
"//libs-scala/resources",
"//libs-scala/scala-utils",
"//libs-scala/timer-utils",
"@maven//:eu_rekawek_toxiproxy_toxiproxy_java_2_1_3",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:org_scalatest_scalatest_compatible",
],
)
for edition in [
"ce",
"ee",
]
]
[
da_scala_test_suite(
name = "failure-tests-{}".format(edition),
srcs = glob(["src/failure/scala/**/*.scala"]),
data = [
@ -519,6 +582,7 @@ test_suite(
scalacopts = hj_scalacopts,
deps = [
":http-json-{}".format(edition),
":failure-tests-lib-{}".format(edition),
"//bazel_tools/runfiles:scala_runfiles",
"//daml-lf/data",
"//language-support/scala/bindings-akka",

View File

@ -0,0 +1,6 @@
// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package com.daml.http
final class FailureTestsCustomToken extends FailureTests with HttpServiceUserFixture.CustomToken

View File

@ -0,0 +1,6 @@
// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package com.daml.http
final class FailureTestsUserToken extends FailureTests with HttpServiceUserFixture.UserToken

View File

@ -31,7 +31,7 @@ import spray.json._
import scala.concurrent.duration._
@SuppressWarnings(Array("org.wartremover.warts.NonUnitStatements"))
sealed abstract class FailureTests
abstract class FailureTests
extends AsyncFreeSpec
with HttpFailureTestFixture
with HttpServiceUserFixture

View File

@ -8,11 +8,3 @@ class TriggerServiceTestAuth
with AbstractTriggerServiceTestInMem
with AbstractTriggerServiceTestAuthMiddleware
with DisableOauthClaimsTests
class TriggerServiceTestAuthClaims
extends AbstractTriggerServiceTest
with AbstractTriggerServiceTestInMem
with AbstractTriggerServiceTestAuthMiddleware {
override protected[this] def oauth2YieldsUserTokens = false
override protected[this] def sandboxClientTakesUserToken = false
}

View File

@ -0,0 +1,12 @@
// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package com.daml.lf.engine.trigger
class TriggerServiceTestAuthClaims
extends AbstractTriggerServiceTest
with AbstractTriggerServiceTestInMem
with AbstractTriggerServiceTestAuthMiddleware {
override protected[this] def oauth2YieldsUserTokens = false
override protected[this] def sandboxClientTakesUserToken = false
}