[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
|
From: |
Ludovic Courtès |
|
Date: |
Thu, 11 Jan 2024 17:44:36 -0500 (EST) |
branch: master
commit 6d259264ff5c05b8cb947575b72ea8646d3a858a
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Jan 11 18:52:32 2024 +0100
tests: Skip store tests when connection to the daemon fails.
* tests/store.scm (store-available?): New variable.
<top level>: Call ‘test-skip’ when it’s false.
---
tests/store.scm | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tests/store.scm b/tests/store.scm
index 554f9c4..d8eaca8 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -57,9 +57,19 @@
(run-with-store store
(lower-object (trivial-thing))))
+(define store-available?
+ ;; Is there a running Guix daemon here?
+ (let ((connection (false-if-exception (open-connection))))
+ (when connection
+ (close-connection connection))
+ (->bool connection)))
+
(test-begin "store")
+;; These tests require access to the store.
+(unless store-available? (test-skip 100))
+
(test-equal "build-derivations&, non-fiber"
'(build-succeeded build-started)
(with-store store