GNU bug report logs - #30701
[PATCH 0/4] PostgreSQL service changes (add record type, and system test)

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sun, 4 Mar 2018 19:12:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 30701 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 30701 <at> debbugs.gnu.org
Subject: Re: [bug#30701] [PATCH 2/3] tests: databases: Add a system test for
 PostgreSQL.
Date: Mon, 05 Mar 2018 12:54:53 +0100
Christopher Baines <mail <at> cbaines.net> writes:

> * gnu/tests/databases.scm (%postgresql-os, %test-postgresql): New variables.
>   (run-postgresql-test): New procedure.
> ---
>  gnu/tests/databases.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
>
> diff --git a/gnu/tests/databases.scm b/gnu/tests/databases.scm
> index e7097690a..583f484d7 100644
> --- a/gnu/tests/databases.scm
> +++ b/gnu/tests/databases.scm
> @@ -30,6 +30,7 @@
>    #:use-module (guix store)
>    #:export (%test-memcached
>              %test-mongodb
> +            %test-postgresql
>              %test-mysql))
>  
>  (define %memcached-os
> @@ -208,6 +209,60 @@
>     (value (run-mongodb-test))))
>  
>  
> +;;;
> +;;; The PostgreSQL service.
> +;;;
> +
> +(define %postgresql-os
> +  (simple-operating-system
> +   (service postgresql-service-type)))
> +
> +(define* (run-postgresql-test)

define, instead of define*

> +  "Run tests in %POSTGRESQL-OS."
> +  (define os
> +    (marionette-operating-system
> +     %postgresql-os
> +     #:imported-modules '((gnu services herd)
> +                          (guix combinators))))
> +
> +  (define vm
> +    (virtual-machine
> +     (operating-system os)
> +     (memory-size 512)))
> +
> +  (define test
> +    (with-imported-modules '((gnu build marionette))
> +      #~(begin
> +          (use-modules (srfi srfi-11) (srfi srfi-64)

I think srfi-11 is useless.

> +                       (gnu build marionette))
> +
> +          (define marionette
> +            (make-marionette (list #$vm)))
> +
> +          (mkdir #$output)
> +          (chdir #$output)
> +
> +          (test-begin "postgresql")
> +
> +          (test-assert "service running"
> +            (marionette-eval
> +             '(begin
> +                (use-modules (gnu services herd))
> +                (start-service 'postgres))
> +             marionette))
> +
> +          (test-end)
> +          (exit (= (test-runner-fail-count (test-runner-current)) 0)))))
> +
> +  (gexp->derivation "postgresql-test" test))
> +
> +(define %test-postgresql
> +  (system-test
> +   (name "postgresql")
> +   (description "Start the PostgreSQL service.")
> +   (value (run-postgresql-test))))
> +
> +
>  ;;;
>  ;;; The MySQL service.
>  ;;;




This bug report was last modified 7 years and 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.