about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-09-25T10·59+0300
committerclbot <clbot@tvl.fyi>2023-09-25T12·46+0000
commit1b3d6975ed8c2a19f1e7f4f39a564cdfa387f0b6 (patch)
tree0405d22f3792a62d79e94668b0d14c1431bd2b75
parent242949ecfbb913d0e1ac50153918f39c6107f21a (diff)
chore(tvix/tests): rename to //tvix/boot r/6652
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 <tvl@lahfa.xyz>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
-rw-r--r--tvix/boot/README.md (renamed from tvix/tests/README.md)14
-rw-r--r--tvix/boot/default.nix (renamed from tvix/tests/default.nix)36
-rw-r--r--tvix/boot/tests/default.nix35
-rw-r--r--tvix/boot/tvix-init.go (renamed from tvix/tests/tvix-init.go)0
4 files changed, 44 insertions, 41 deletions
diff --git a/tvix/tests/README.md b/tvix/boot/README.md
index 8cb4e9a659..79fca31ebc 100644
--- a/tvix/tests/README.md
+++ b/tvix/boot/README.md
@@ -1,15 +1,9 @@
-# tvix/tests
+# tvix/boot
 
-This directory provides a bunch of integration tests using tvix.
+This directory provides tooling to boot VMs with /nix/store provided by
+virtiofs.
 
-The currently most interesting (and only) ones ;-) are using a cloud-hypervisor
-VM.
-
-## //tvix/tests:test-docs
-This is a test encapsulated in a nix build.
-It seeds a tvix-store with the tvix docs, then starts a VM, asks it to list all
-files in /nix/store, and ensures the store path is present, which acts as a
-nice smoketest.
+In the `tests/` subdirectory, there's some integration tests.
 
 ## //tvix/tests:runVM
 A script spinning up a `tvix-store virtiofs` daemon, then starting a cloud-
diff --git a/tvix/tests/default.nix b/tvix/boot/default.nix
index 875fe0b9f1..8c20c35f6b 100644
--- a/tvix/tests/default.nix
+++ b/tvix/boot/default.nix
@@ -103,35 +103,9 @@ rec {
      --fs tag=tvix,socket=$tempdir/tvix.sock,num_queues=1,queue_size=512
   '';
 
-  # Seed a tvix-store with the tvix docs, then start a VM and search for the
-  # store path in the output.
-  test-docs = pkgs.stdenv.mkDerivation {
-    name = "run-vm";
-    nativeBuildInputs = [
-      depot.tvix.store
-    ];
-    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" ${runVM}/bin/run-tvix-vm 2>&1 | tee output.txt
-      grep ${../docs} output.txt
-    '';
-    requiredSystemFeatures = [ "kvm" ];
-  };
-
-  meta.ci.targets = [ "test-docs" ];
+  meta.ci.targets = [
+    "initrd"
+    "kernel"
+    "runVM"
+  ];
 }
diff --git a/tvix/boot/tests/default.nix b/tvix/boot/tests/default.nix
new file mode 100644
index 0000000000..d725a7ac9b
--- /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" ];
+  };
+}
diff --git a/tvix/tests/tvix-init.go b/tvix/boot/tvix-init.go
index 97a24bab35..97a24bab35 100644
--- a/tvix/tests/tvix-init.go
+++ b/tvix/boot/tvix-init.go