about summary refs log tree commit diff
path: root/tvix/glue/src/tests/tvix_tests/eval-okay-fetchurl.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-04-22T13·51+0300
committerflokli <flokli@flokli.de>2024-04-23T12·41+0000
commitdfef3d18d177bbeadcc3000cc39ef0a16a566a1f (patch)
tree2eb7d5e5b5121d36e3557b4392e36ea70e023932 /tvix/glue/src/tests/tvix_tests/eval-okay-fetchurl.nix
parent30950833c943c6b6b48d204ab0027f38af356f5c (diff)
test(tvix/glue): add tests for fetchurl and fetchTarball r/7995
Change-Id: I53a0590ecf4e5fcb1bfd1d127824211338e28256
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11503
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Diffstat (limited to '')
-rw-r--r--tvix/glue/src/tests/tvix_tests/eval-okay-fetchurl.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/tvix/glue/src/tests/tvix_tests/eval-okay-fetchurl.nix b/tvix/glue/src/tests/tvix_tests/eval-okay-fetchurl.nix
new file mode 100644
index 0000000000..80fe808c21
--- /dev/null
+++ b/tvix/glue/src/tests/tvix_tests/eval-okay-fetchurl.nix
@@ -0,0 +1,23 @@
+[
+  # (fetchurl "url") cannot be tested, as that one has to fetch from the
+  # internet to calculate the path.
+
+  # fetchurl with url and sha256
+  (builtins.fetchurl {
+    url = "https://raw.githubusercontent.com/aaptel/notmuch-extract-patch/f732a53e12a7c91a06755ebfab2007adc9b3063b/notmuch-extract-patch";
+    sha256 = "0nawkl04sj7psw6ikzay7kydj3dhd0fkwghcsf5rzaw4bmp4kbax";
+  })
+
+  # fetchurl with url and sha256 (as SRI)
+  (builtins.fetchurl {
+    url = "https://raw.githubusercontent.com/aaptel/notmuch-extract-patch/f732a53e12a7c91a06755ebfab2007adc9b3063b/notmuch-extract-patch";
+    sha256 = "sha256-Xa1Jbl2Eq5+L0ww+Ph1osA3Z/Dxe/RkN1/dITQCdXFk=";
+  })
+
+  # fetchurl with another url, but same name
+  (builtins.fetchurl {
+    url = "https://test.example/owo";
+    name = "notmuch-extract-patch";
+    sha256 = "sha256-Xa1Jbl2Eq5+L0ww+Ph1osA3Z/Dxe/RkN1/dITQCdXFk=";
+  })
+]