daml/libs-haskell/da-hs-base/BUILD.bazel
Sofia Faro 09013eb501
Add eager timeouts to the polling functions used in daml start and assistant integration tests. (#12361)
* Add timeouts to polling funcs in daml start.

This PR adds timeouts to some polling functions used in daml start and
the assistant integration tests, and also early exits based on a process
exit status. E.g. waitForHttpServer will make sure some process is
still running, instead of waiting to timeout.

The effect of this is that now whenever there is some error in a
subprocess, daml start and the integration tests will finish early
instead of running forever (or timing out in bazel).

changelog_begin
changelog_end

* missing a readPortFile instance
2022-01-12 10:01:56 +00:00

86 lines
2.0 KiB
Python

# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("//bazel_tools:haskell.bzl", "da_haskell_library", "da_haskell_test")
load("@os_info//:os_info.bzl", "is_windows")
da_haskell_library(
name = "da-hs-base",
srcs = glob(["src/**/*.hs"]),
hackage_deps = [
"aeson-pretty",
"aeson",
"ansi-terminal",
"async",
"base",
"base16-bytestring",
"base64-bytestring",
"binary",
"blaze-html",
"bytestring",
"conduit",
"containers",
"deepseq",
"directory",
"dlist",
"extra",
"filepath",
"hashable",
"http-conduit",
"http-types",
"lens",
"monad-loops",
"mtl",
"network",
"optparse-applicative",
"pretty-show",
"pretty",
"process",
"random",
"safe",
"safe-exceptions",
"stm",
"tar-conduit",
"tasty-hunit",
"tasty-quickcheck",
"tasty",
"template-haskell",
"text",
"time",
"transformers-base",
"transformers",
"unordered-containers",
"unix-compat",
"utf8-string",
"uuid",
"vector",
] + ([] if is_windows else ["unix"]),
src_strip_prefix = "src",
visibility = ["//visibility:public"],
deps = [
"//:sdk-version-hs-lib",
"//daml-assistant:daml-project-config",
],
)
da_haskell_test(
name = "da-hs-base-tests",
srcs = glob(["tests/**/*.hs"]),
hackage_deps = [
"aeson",
"extra",
"tasty",
"base",
"directory",
"tasty-hunit",
"text",
],
main_function = "Telemetry.main",
visibility = ["//visibility:public"],
deps = [
":da-hs-base",
"//daml-assistant:daml-project-config",
"//libs-haskell/test-utils",
],
)