about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-06-29T14·51+0300
committerflokli <flokli@flokli.de>2024-06-29T16·56+0000
commit50ed7f27d092ab95bd7565ed000de3e4d23a9b7c (patch)
tree578b7957aeebeef34ce08e24d5c828530811177f
parent0fd4a1a65512753fd37dbf0cb0832b6711465c27 (diff)
feat(tvix/boot/tests): add preStart parameter r/8324
This allows running some code before tvix-daemon is started up, which is
helpful to spin up some mock services.

Change-Id: Ie7b6eaaf76c40def493f50879ee5255fd1ebd2fe
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11893
Tested-by: BuildkiteCI
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
-rw-r--r--tvix/boot/tests/default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/boot/tests/default.nix b/tvix/boot/tests/default.nix
index 87530da0da8b..22f9de6bb5f7 100644
--- a/tvix/boot/tests/default.nix
+++ b/tvix/boot/tests/default.nix
@@ -23,6 +23,10 @@ let
 
     , importPathName ? null
 
+      # Commands to run before starting the tvix-daemon. Useful to provide
+      # auxillary mock services.
+    , preStart ? ""
+
       # The cmdline to pass to the VM.
       # Defaults to tvix.find, which lists all files in the store.
     , vmCmdline ? "tvix.find"
@@ -51,6 +55,8 @@ let
           # Ensure we can construct http clients.
           export SSL_CERT_FILE="${pkgs.cacert.out}/etc/ssl/certs/ca-bundle.crt"
 
+          ${preStart}
+
           # Start the tvix daemon, listening on a unix socket.
           BLOB_SERVICE_ADDR=${blobServiceAddr} \
             DIRECTORY_SERVICE_ADDR=${directoryServiceAddr} \