Skip to content

Commit

Permalink
Migrate matches-docs tests to sandbox on postgres (#11573)
Browse files Browse the repository at this point in the history
* Migrate matches-docs tests to sandbox on postgres

We’ve seen timeouts on party allocation which are likely caused by the
h2 issues that keep popping up. Switching to postgres should hopefully
solve that.

We need to wrap postgres to set LOCALE_ARCHIVE for this to work in
builds. We already pass it through in tests which is why it works fine there.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* Update nix/bazel.nix

Co-authored-by: Andreas Herrmann <[email protected]>

* disable on Windows

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <[email protected]>
  • Loading branch information
cocreature and aherrmann-da authored Nov 8, 2021
1 parent 21c9745 commit a3d04ca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
8 changes: 5 additions & 3 deletions daml-script/export/integration-tests/matches-docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_binary",
)
load("@os_info//:os_info.bzl", "is_windows")

da_scala_binary(
name = "example-export-client",
Expand Down Expand Up @@ -49,13 +50,14 @@ client_server_build(
client_files = ["//daml-script/test:script-test.dar"],
data = ["//daml-script/test:script-test.dar"],
output_env = "EXPORT_OUT",
server = "//ledger/sandbox:sandbox-binary",
server = "//ledger/sandbox:sandbox-ephemeral-postgresql",
server_args = [
"--port=0",
"--port-file=%PORT_FILE%",
],
server_files = ["//daml-script/test:script-test.dar"],
)
) if not is_windows else None
# Disabled on Windows since postgres gets unhappy in client_server_build.

# Compare the generated Daml ledger export to the example export used in the
# documentation. This functions as both a golden test on ledger exports and to
Expand Down Expand Up @@ -105,4 +107,4 @@ $(POSIX_DIFF) -Naur --strip-trailing-cr <($(POSIX_SED) '1,3d;s/[0-9a-f]\\{{64\\}
"//docs:source/tools/export/output-root/daml.yaml",
],
toolchains = ["@rules_sh//sh/posix:make_variables"],
)
) if not is_windows else None
15 changes: 13 additions & 2 deletions nix/bazel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,23 @@ let shared = rec {
openssl
gnupatch
patchelf
postgresql_9_6
protobuf3_8
python3
toxiproxy
zip
;
;

postgresql_9_6 = if pkgs.buildPlatform.libc == "glibc"
then pkgs.runCommand "postgresql_9_6_wrapper" { buildInputs = [ pkgs.makeWrapper ]; } ''
mkdir -p $out/bin
for tool in ${pkgs.postgresql_9_6}/bin/*; do
makeWrapper $tool $out/bin/$(basename $tool) --set LOCALE_ARCHIVE ${pkgs.glibcLocales}/lib/locale/locale-archive
done
ln -s ${pkgs.postgresql_9_6}/include $out/include
ln -s ${pkgs.postgresql_9_6}/lib $out/lib
ln -s ${pkgs.postgresql_9_6}/share $out/share
'' else pkgs.postgresql_9_6;


scala_2_12 = (pkgs.scala_2_12.override { }).overrideAttrs (attrs: {
# Something appears to be broken in nixpkgs' fixpoint which results in the
Expand Down

0 comments on commit a3d04ca

Please sign in to comment.