diff options
author | Arun Isaac | 2025-08-24 19:25:10 +0100 |
---|---|---|
committer | Arun Isaac | 2025-08-24 19:25:10 +0100 |
commit | 5e6596ac7decbe88c03314e543efe1922edce13f (patch) | |
tree | 1ab35dd703d7b31021f09bca96b7e89c8e951cc1 | |
parent | c2c22bc3a215e2a0d57c976a9aa337df95297ba1 (diff) | |
download | ravanan-5e6596ac7decbe88c03314e543efe1922edce13f.tar.gz ravanan-5e6596ac7decbe88c03314e543efe1922edce13f.tar.lz ravanan-5e6596ac7decbe88c03314e543efe1922edce13f.zip |
guix: Move end-to-end tests to separate file.
It's easier to build a file from the command-line, rather than an expression.
-rw-r--r-- | .guix/cwl-conformance.scm | 92 | ||||
-rw-r--r-- | HACKING.md | 2 |
2 files changed, 3 insertions, 91 deletions
diff --git a/.guix/cwl-conformance.scm b/.guix/cwl-conformance.scm index 42d25d1..aad3b3a 100644 --- a/.guix/cwl-conformance.scm +++ b/.guix/cwl-conformance.scm @@ -19,17 +19,13 @@ (define-module (cwl-conformance) #:use-module ((cwltest-package) #:select (cwltest)) #:use-module ((ravanan-package) #:select (ravanan)) - #:use-module ((gnu packages bioinformatics) #:select (ccwl)) - #:use-module ((gnu packages nss) #:select (nss-certs)) #:use-module ((gnu packages python) #:select (python)) #:use-module ((gnu packages python-web) #:select (python-pybadges)) - #:use-module (guix build utils) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix packages) - #:use-module (guix profiles) - #:use-module (guix utils) - #:use-module (ice-9 match)) + #:use-module (ice-9 match) + #:export (cwltest-suite-gexp)) (define* (cwltest-suite-gexp cwltest-suite manifest-file #:key (skip-tests '())) (with-imported-modules '((guix build utils)) @@ -80,88 +76,4 @@ "env_home_tmpdir_docker" "env_home_tmpdir_docker_no_return_code")))) -(define (ccwl-compile source-file) - #~(begin - (use-modules (rnrs io ports) - (srfi srfi-26) - (ice-9 match) - (ice-9 popen)) - - (define (call-with-input-pipe command proc) - (match command - ((prog args ...) - (let ((port #f)) - (dynamic-wind - (lambda () - (set! port (apply open-pipe* OPEN_READ prog args))) - (cut proc port) - (lambda () - (unless (zero? (close-pipe port)) - (error "Command invocation failed" command)))))))) - - (call-with-output-file #$output - (cut display - (call-with-input-pipe '(#$(file-append ccwl "/bin/ccwl") - "compile" - #$source-file) - get-string-all) - <>)))) - -(define e2e-tools-ccwl-sources - `(("hello-world.scm" . ,(local-file "../e2e-tests/tools/hello-world.scm")))) - -(define e2e-tools - (file-union "e2e-tools" - (map (match-lambda - ((ccwl-source-filename . ccwl-source-file) - (let ((cwl-filename (string-append (basename ccwl-source-filename ".scm") - ".cwl"))) - (list cwl-filename - (computed-file cwl-filename - (ccwl-compile ccwl-source-file)))))) - e2e-tools-ccwl-sources))) - -(define e2e-test-suite - (file-union "e2e-test-suite" - `(("tests.yaml" ,(local-file "../e2e-tests/tests.yaml")) - ("tools" ,e2e-tools) - ("jobs" ,(local-file "../e2e-tests/jobs" - #:recursive? #t))))) - -(define-public e2e-tests - (program-file "e2e-tests" - (cwltest-suite-gexp (file-append e2e-test-suite "/tests.yaml") - (local-file "../e2e-tests/manifest.scm")))) - -(define generate-badges-gexp - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (ice-9 match)) - - (match (command-line) - ((_ cwltest-badgedir output-directory) - (set-path-environment-variable - "GUIX_PYTHONPATH" - '(#$(string-append "lib/python" - (version-major+minor (package-version python)) - "/site-packages")) - (list #$(profile - (content (packages->manifest - (list python python-pybadges)))))) - (invoke #$(file-append python "/bin/python3") - #$(local-file "../cwl-conformance/badgegen.py") - cwltest-badgedir - #$(local-file "../cwl-conformance/commonwl.svg") - output-directory)) - ((program _ ...) - (format (current-error-port) - "Usage: ~a CWLTEST_BADGEDIR OUTPUT-DIRECTORY~%" - program) - (exit #f)))))) - -(define-public generate-badges - (program-file "generate-badges" - generate-badges-gexp)) - cwl-v1.2-conformance diff --git a/HACKING.md b/HACKING.md index e456242..85cb4d4 100644 --- a/HACKING.md +++ b/HACKING.md @@ -14,5 +14,5 @@ cd rundir ``` Then, build and run the tests. ``` -$(guix build -L ../.guix -e '(@ (cwl-conformance) e2e-tests)') +$(guix build -L ../.guix -f ../.guix/e2e-tests.scm) ``` |