diff options
-rw-r--r-- | HACKING.md | 12 | ||||
-rw-r--r-- | e2e-tests/.gitignore | 1 | ||||
-rw-r--r-- | e2e-tests/Makefile | 37 | ||||
-rw-r--r-- | e2e-tests/jobs/hello-world.yaml | 1 | ||||
-rw-r--r-- | e2e-tests/manifest.scm | 2 | ||||
-rw-r--r-- | e2e-tests/tests.yaml | 9 | ||||
-rw-r--r-- | e2e-tests/tools/hello-world.scm | 3 |
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)) |