From bebcf97600b2fa65482ae8ee870800dafa34d3f8 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 22 Feb 2021 15:41:06 +0100 Subject: services: cuirass: Improve simple-cuirass-services. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of returning multiple services in simple-cuirass-services, rely on the instantiate-missing-services procedure to instantiate postgresql and postgresql-role-service-type when missing. Turn simple-cuirass-services procedure into simple-cuirass-configuration->specs, that takes a simple-cuirass-configuration record and returns a Cuirass specification. Suggested-by: Ludovic Courtès * gnu/services/cuirass.scm (%default-cuirass-config): Remove it. (simple-cuirass-services): Rename it to ... (simple-cuirass-configuration->specs): ... this procedure. * gnu/tests/cuirass.scm (cuirass-services): Remove postgresql and postgresql-role services that are automatically instantiated. (simple-cuirass-service): New variable. (%cuirass-simple-test): Adapt it to use simple-cuirass-configuration->specs instead of simple-cuirass-services. * doc/guix.texi (Simple Cuirass): Update it. --- gnu/tests/cuirass.scm | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/tests/cuirass.scm b/gnu/tests/cuirass.scm index 22eab3c456..e833a047ad 100644 --- a/gnu/tests/cuirass.scm +++ b/gnu/tests/cuirass.scm @@ -132,11 +132,7 @@ (remote-server (and remote-build? (cuirass-remote-server-configuration))) (host "0.0.0.0") - (use-substitutes? #t))) - (service postgresql-service-type - (postgresql-configuration - (postgresql postgresql-10))) - (service postgresql-role-service-type))) + (use-substitutes? #t))))) (define (run-cuirass-test name os) (define os* @@ -286,6 +282,20 @@ (description "Connect to a Cuirass server with remote build.") (value (run-cuirass-test name os))))) +(define simple-cuirass-service + (service cuirass-service-type + (cuirass-configuration + (specifications + (simple-cuirass-configuration->specs + (simple-cuirass-configuration + (build 'all) + (channels + (list (channel + (name 'guix) + (url "file:///tmp/cuirass-main/"))))))) + (host "0.0.0.0") + (use-substitutes? #t)))) + (define %cuirass-simple-test (let ((os (operating-system (inherit %simple-os) @@ -293,17 +303,8 @@ (append (list cow-service (service dhcp-client-service-type) - git-service) - (simple-cuirass-services - (simple-cuirass-configuration - (build 'all) - (channels (list (channel - (name 'guix) - (url "file:///tmp/cuirass-main/"))))) - (cuirass-configuration - (inherit %default-cuirass-config) - (host "0.0.0.0") - (use-substitutes? #t))) + git-service + simple-cuirass-service) (operating-system-user-services %simple-os)))))) (system-test (name "cuirass-simple") -- cgit v1.2.3