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


View this message in rfc822 format

From: Clément Lassieur <clement <at> lassieur.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 30701 <at> debbugs.gnu.org
Subject: [bug#30701] [PATCH 3/4] tests: databases: Add a system test for PostgreSQL.
Date: Mon, 05 Mar 2018 01:32:32 +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 | 59 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
...

> +          (test-assert "service running"
> +            (marionette-eval
> +             '(begin
> +                (use-modules (gnu services herd))
> +                (match (start-service 'postgres)
> +                  (#f #f)
> +                  (('service response-parts ...)
> +                   (match (assq-ref response-parts 'running)
> +                     ((pid) (number? pid))))))
> +             marionette))

I don't understand the point of the PID check here.  pg_ctl will ensure
that the daemon has started (by checking its PID), so I don't think
there is any need to redo its work.  I guess the PID you'll get here is
the one of pg_ctl, which is probably not what you want.

I believe that (start-service 'postgres) returning true means pg_ctl
succeeded in its check that the daemon is running.  So this is probably
enough:

          (test-assert "service running"
            (marionette-eval
             '(begin
                (use-modules (gnu services herd))
                (start-service 'postgres))
             marionette))

Clément




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.