[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#30701] [PATCH 2/3] tests: databases: Add a system test for PostgreS
From: |
Clément Lassieur |
Subject: |
[bug#30701] [PATCH 2/3] tests: databases: Add a system test for PostgreSQL. |
Date: |
Mon, 05 Mar 2018 12:54:53 +0100 |
User-agent: |
mu4e 1.0; emacs 25.3.1 |
Christopher Baines <address@hidden> 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.
> ;;;
- [bug#30701] [PATCH 2/4] services: Use a external pid file for PostgreSQL., (continued)
[bug#30701] [PATCH 1/4] services: Rework the PostgreSQL config file to use a record type., Clément Lassieur, 2018/03/04
[bug#30701] [PATCH 1/3] services: Rework the PostgreSQL config file to use a record type., Christopher Baines, 2018/03/05
[bug#30701] [PATCH 3/3] services: databases: Add postgresql-configuration record exports., Christopher Baines, 2018/03/05
[bug#30701] [PATCH 1/3] services: Rework the PostgreSQL config file to use a record type., Christopher Baines, 2018/03/05