From 86ab052fe037715828e2856e6c700b97d7de20ca Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 29 Jun 2024 17:52:53 +0300 Subject: feat(tvix/boot/tests): closure-nixos-bigtable This uses the `preStart` mechanism to boot up a bigtable emulator, which we point directory/pathinfoservice to. Change-Id: Icb383403cb2d1f7e19c71b6298e82b391f9c8d22 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11895 Autosubmit: flokli Reviewed-by: Connor Brewster Tested-by: BuildkiteCI --- tvix/boot/tests/default.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tvix/boot/tests') diff --git a/tvix/boot/tests/default.nix b/tvix/boot/tests/default.nix index 785ff96570ab..fb7d14f8b5cd 100644 --- a/tvix/boot/tests/default.nix +++ b/tvix/boot/tests/default.nix @@ -178,6 +178,27 @@ depot.nix.readTree.drvTargets assertVMOutput = "Onwards and upwards."; }); + closure-nixos-bigtable = (mkBootTest { + blobServiceAddr = "objectstore+file:///build/blobs"; + directoryServiceAddr = "bigtable://instance-1?project_id=project-1&table_name=directories&family_name=cf1"; + pathInfoServiceAddr = "bigtable://instance-1?project_id=project-1&table_name=pathinfos&family_name=cf1"; + path = testSystem; + useNarBridge = true; + preStart = '' + ${pkgs.cbtemulator}/bin/cbtemulator -address $PWD/cbtemulator.sock & + timeout 22 sh -c 'until [ -e $PWD/cbtemulator.sock ]; do sleep 1; done' + + export BIGTABLE_EMULATOR_HOST=unix://$PWD/cbtemulator.sock + ${pkgs.google-cloud-bigtable-tool}/bin/cbt -instance instance-1 -project project-1 createtable directories + ${pkgs.google-cloud-bigtable-tool}/bin/cbt -instance instance-1 -project project-1 createfamily directories cf1 + ${pkgs.google-cloud-bigtable-tool}/bin/cbt -instance instance-1 -project project-1 createtable pathinfos + ${pkgs.google-cloud-bigtable-tool}/bin/cbt -instance instance-1 -project project-1 createfamily pathinfos cf1 + ''; + isClosure = true; + vmCmdline = "init=${testSystem}/init panic=-1"; # reboot immediately on panic + assertVMOutput = "Onwards and upwards."; + }); + closure-nixos-nar-bridge = (mkBootTest { blobServiceAddr = "objectstore+file:///build/blobs"; path = testSystem; -- cgit 1.4.1