From 787543f748d4a14c3312cee9e13468ed0c6d206a Mon Sep 17 00:00:00 2001 From: Moritz Kiefer Date: Tue, 10 Mar 2020 11:09:33 +0100 Subject: [PATCH 1/2] Include Bazel patch to mark tests as exclusive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should hopefully avoid rerunning the conformance tests as often as we do now. While this patch is not applied on Windows (since we get it from nix), this is not really an issue since most of the exclusive tests (in particular, all conformance tests) are disabled on Windows anyway. I’ve tested this locally accross a couple of runs and I get the caching I want and looking at the code in the patch, the change looks very reasonable. I somewhat wonder if it just broke internally at google because they marked tests as exclusive that should have gotten no-cache. changelog_begin changelog_end --- nix/nixpkgs.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix index ffc9c183e333..8c7eb1897832 100644 --- a/nix/nixpkgs.nix +++ b/nix/nixpkgs.nix @@ -28,6 +28,21 @@ let wrapProgram $out/bin/pg_tmp --prefix PATH : ${pkgs.postgresql_9_6}/bin:$out/bin ''; }); + bazel = pkgs.bazel.overrideAttrs(oldAttrs: { + patches = oldAttrs.patches ++ [ + # Note (MK) + # This patch enables caching of tests marked as `exclusive`. It got apparently + # rolled back because it caused problems internally at Google but it’s unclear + # what is actually failing and it seems to work fine for us. + # See https://github.com/bazelbuild/bazel/pull/8983/files#diff-107db037d4a55f2421fed9ed5c6cc31b + # for the only change that actually affects the code in this patch. The rest is tests + # and/or documentation. + (pkgs.fetchurl { + url = "https://patch-diff.githubusercontent.com/raw/bazelbuild/bazel/pull/8983.patch"; + sha256 = "1j25bycn9q7536ab3ln6yi6zpzv2b25fwdyxbgnalkpl2dz9idb7"; + }) + ]; + }); }; nixpkgs = import src { From 98152ced1367727b60777734a318eb35be308e7d Mon Sep 17 00:00:00 2001 From: Moritz Kiefer Date: Tue, 10 Mar 2020 12:22:13 +0100 Subject: [PATCH 2/2] Disable caching for canton --- ledger/ledger-api-test-tool-on-canton/BUILD.bazel | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ledger/ledger-api-test-tool-on-canton/BUILD.bazel b/ledger/ledger-api-test-tool-on-canton/BUILD.bazel index 586b27445771..f9301243b3e9 100644 --- a/ledger/ledger-api-test-tool-on-canton/BUILD.bazel +++ b/ledger/ledger-api-test-tool-on-canton/BUILD.bazel @@ -65,6 +65,9 @@ conformance_test( ], runner = "@//bazel_tools/client_server/runner:runner", server = ":canton-test-runner-with-dependencies", + # NOTE (MK): Canton tries to access ~/.ammonite/cache for the coursier cache which fails with sandboxing + # and caching. This might be fixable by overriding COURSIER_CACHE. + tags = ["local"], test_tool_args = [ "--verbose", "--include=SemanticTests",