From 1b3d6975ed8c2a19f1e7f4f39a564cdfa387f0b6 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 25 Sep 2023 13:59:25 +0300 Subject: chore(tvix/tests): rename to //tvix/boot This is mostly boot tooling, the integration test is just one instance making use of it. Expose initrd, kernel and runVM as a separate target to CI, and move the tests to a subdirectory. Change-Id: I1d22cd68bf5af095bc11dd9d7117b62956c7f7f2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9465 Reviewed-by: raitobezarius Autosubmit: flokli Tested-by: BuildkiteCI --- tvix/boot/tests/default.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tvix/boot/tests/default.nix (limited to 'tvix/boot/tests/default.nix') diff --git a/tvix/boot/tests/default.nix b/tvix/boot/tests/default.nix new file mode 100644 index 000000000000..d725a7ac9bb7 --- /dev/null +++ b/tvix/boot/tests/default.nix @@ -0,0 +1,35 @@ +{ depot, pkgs, ... }: + +depot.nix.readTree.drvTargets { + # Seed a tvix-store with the tvix docs, then start a VM, ask it to list all + # files in /nix/store, and ensure the store path is present, which acts as a + # nice smoketest. + docs = pkgs.stdenv.mkDerivation { + name = "run-vm"; + nativeBuildInputs = [ + depot.tvix.store + depot.tvix.boot.runVM + ]; + buildCommand = '' + touch $out + + # Configure tvix to put data in the local working directory + export BLOB_SERVICE_ADDR=sled://$PWD/blobs.sled + export DIRECTORY_SERVICE_ADDR=sled://$PWD/directories.sled + export PATH_INFO_SERVICE_ADDR=sled://$PWD/pathinfo.sled + + # Seed the tvix store with some data + # Create a `docs` directory with the contents from ../docs + # Make sure it still is called "docs" when calling import, so we can + # predict the store path. + cp -R ${../../docs} docs + outpath=$(tvix-store import docs) + + echo "Store contents imported to $outpath" + + CH_CMDLINE="tvix.find" run-tvix-vm 2>&1 | tee output.txt + grep ${../../docs} output.txt + ''; + requiredSystemFeatures = [ "kvm" ]; + }; +} -- cgit 1.4.1