about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2025-08-24 12:33:55 +0100
committerArun Isaac2025-08-24 14:24:11 +0100
commit14845d344ef346029fc58b7c66be6bc43b70a661 (patch)
tree0621c55ff85841ff3bb02bca438c417d434dd442
parentace57b16ee9fa46aaeb2a9f7980ecd24d97aa26c (diff)
downloadravanan-14845d344ef346029fc58b7c66be6bc43b70a661.tar.gz
ravanan-14845d344ef346029fc58b7c66be6bc43b70a661.tar.lz
ravanan-14845d344ef346029fc58b7c66be6bc43b70a661.zip
Add end-to-end tests.
End-to-end tests allow us to test the whole of ravanan. This is a
useful sanity check to ensure that basic workflows remain working.
-rw-r--r--HACKING.md12
-rw-r--r--e2e-tests/.gitignore1
-rw-r--r--e2e-tests/Makefile37
-rw-r--r--e2e-tests/jobs/hello-world.yaml1
-rw-r--r--e2e-tests/manifest.scm2
-rw-r--r--e2e-tests/tests.yaml9
-rw-r--r--e2e-tests/tools/hello-world.scm3
7 files changed, 65 insertions, 0 deletions
diff --git a/HACKING.md b/HACKING.md
index 3b3da27..7bb6691 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -4,3 +4,15 @@ Drop into a development environment using `guix shell`. This shell includes addi
 ```
 guix shell -L .guix -Df manifest.scm
 ```
+
+# Run end-to-end tests
+
+ravanan comes with a suite of end-to-end tests under `e2e-tests`. To run them, first compile the required CWL workflows from the ccwl sources.
+```
+make -C e2e-tests
+```
+Then, run cwltest like so:
+```
+make -C e2e-tests check
+```
+End-to-end tests require a running Guix daemon.
diff --git a/e2e-tests/.gitignore b/e2e-tests/.gitignore
new file mode 100644
index 0000000..321232f
--- /dev/null
+++ b/e2e-tests/.gitignore
@@ -0,0 +1 @@
+tools/*.cwl
\ No newline at end of file
diff --git a/e2e-tests/Makefile b/e2e-tests/Makefile
new file mode 100644
index 0000000..1410a6d
--- /dev/null
+++ b/e2e-tests/Makefile
@@ -0,0 +1,37 @@
+# ravanan --- High-reproducibility CWL runner powered by Guix
+# Copyright © 2025 Arun Isaac <arunisaac@systemreboot.net>
+#
+# This file is part of ravanan.
+#
+# ravanan is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# ravanan is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with ravanan.  If not, see <https://www.gnu.org/licenses/>.
+
+CCWL ?= ccwl
+CWLTEST ?= cwltest
+
+tools_directory = tools
+tool_ccwl = $(wildcard $(tools_directory)/*.scm)
+tool_cwl = $(tool_ccwl:.scm=.cwl)
+
+all: $(tool_cwl)
+
+%.cwl: %.scm
+	$(CCWL) compile $^ > $@
+
+.PHONY: check clean
+check:
+	mkdir -p /tmp/cwltest-tmpdir
+	TMPDIR=/tmp/cwltest-tmpdir ../pre-inst-env $(CWLTEST) --test tests.yaml --tool ravanan -- --store=store --guix-manifest=manifest.scm
+
+clean:
+	rm -f $(tool_cwl)
diff --git a/e2e-tests/jobs/hello-world.yaml b/e2e-tests/jobs/hello-world.yaml
new file mode 100644
index 0000000..5329e73
--- /dev/null
+++ b/e2e-tests/jobs/hello-world.yaml
@@ -0,0 +1 @@
+message: Hello world!
diff --git a/e2e-tests/manifest.scm b/e2e-tests/manifest.scm
new file mode 100644
index 0000000..da7eb55
--- /dev/null
+++ b/e2e-tests/manifest.scm
@@ -0,0 +1,2 @@
+(specifications->manifest
+ (list "coreutils"))
diff --git a/e2e-tests/tests.yaml b/e2e-tests/tests.yaml
new file mode 100644
index 0000000..5c0ab22
--- /dev/null
+++ b/e2e-tests/tests.yaml
@@ -0,0 +1,9 @@
+- id: hello-world
+  doc: Hello world!
+  tool: tools/hello-world.cwl
+  job: jobs/hello-world.yaml
+  output:
+    output_message:
+      class: File
+      size: 13
+      checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b
diff --git a/e2e-tests/tools/hello-world.scm b/e2e-tests/tools/hello-world.scm
new file mode 100644
index 0000000..a037a36
--- /dev/null
+++ b/e2e-tests/tools/hello-world.scm
@@ -0,0 +1,3 @@
+(command #:inputs (message #:type string)
+         #:run "echo" message
+         #:outputs (output_message #:type stdout))