unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#37855] [PATCH] gnu: guix-data-service: Enable build time tests.
@ 2019-10-21 17:42 Christopher Baines
  2019-10-22 16:17 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Baines @ 2019-10-21 17:42 UTC (permalink / raw)
  To: 37855

Previously the tests were not run, as PostgreSQL wasn't running at build
time. Now there's a new target, check-with-tmp-database that uses ephemeralpg
to run the tests without relying on an externally managed PostgreSQL service.

* gnu/packages/web.scm (guix-data-service)[arguments]: Remove #:tests? #f, and
set #:test-target to "check-with-tmp-database".
[native-inputs]: Add ephemeralpg.
---
 gnu/packages/web.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 5487eb2e71..a91059f73d 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -4044,11 +4044,11 @@ CDF, Atom 0.3, and Atom 1.0 feeds.")
                   "0awfvps7k9bpg3gpgc93y401g7pjabx7mr9960vigad8vddhixqi"))))
       (build-system gnu-build-system)
       (arguments
-       '(#:tests? #f                    ; TODO Tests require PostgreSQL
-         #:modules ((guix build utils)
+       '(#:modules ((guix build utils)
                     (guix build gnu-build-system)
                     (ice-9 rdelim)
                     (ice-9 popen))
+         #:test-target "check-with-tmp-database"
          #:phases
          (modify-phases %standard-phases
            (add-after 'set-paths 'set-GUIX_ENVIRONMENT
@@ -4106,6 +4106,7 @@ CDF, Atom 0.3, and Atom 1.0 feeds.")
        `(("guile" ,guile-2.2)
          ("autoconf" ,autoconf)
          ("automake" ,automake)
+         ("ephemeralpg" ,ephemeralpg)
          ("emacs-with-modules" ,(directory-union
                                  "emacs-union"
                                  (list emacs-no-x
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#37855] [PATCH] gnu: guix-data-service: Enable build time tests.
  2019-10-21 17:42 [bug#37855] [PATCH] gnu: guix-data-service: Enable build time tests Christopher Baines
@ 2019-10-22 16:17 ` Ludovic Courtès
  2019-10-22 22:08   ` bug#37855: " Christopher Baines
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2019-10-22 16:17 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 37855

Hi,

Christopher Baines <mail@cbaines.net> skribis:

> Previously the tests were not run, as PostgreSQL wasn't running at build
> time. Now there's a new target, check-with-tmp-database that uses ephemeralpg
> to run the tests without relying on an externally managed PostgreSQL service.
>
> * gnu/packages/web.scm (guix-data-service)[arguments]: Remove #:tests? #f, and
> set #:test-target to "check-with-tmp-database".
> [native-inputs]: Add ephemeralpg.

Nice, LGTM!

I wonder: can’t you just have “make check” do this, or do you want to
have “make check” talk to a real database instead?

(For the Guix test suite, ‘test-env’ spawns a daemon with a temporary
store for test purposes; I wonder if the situation is comparable here.)

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#37855: [PATCH] gnu: guix-data-service: Enable build time tests.
  2019-10-22 16:17 ` Ludovic Courtès
@ 2019-10-22 22:08   ` Christopher Baines
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Baines @ 2019-10-22 22:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 37855-done

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]


Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Christopher Baines <mail@cbaines.net> skribis:
>
>> Previously the tests were not run, as PostgreSQL wasn't running at build
>> time. Now there's a new target, check-with-tmp-database that uses ephemeralpg
>> to run the tests without relying on an externally managed PostgreSQL service.
>>
>> * gnu/packages/web.scm (guix-data-service)[arguments]: Remove #:tests? #f, and
>> set #:test-target to "check-with-tmp-database".
>> [native-inputs]: Add ephemeralpg.
>
> Nice, LGTM!

Great, I've pushed this now as 353f5f7aa7ea575f9f04d3a0b277bbb8012b942d.

> I wonder: can’t you just have “make check” do this, or do you want to
> have “make check” talk to a real database instead?

It's mostly a new target as I already had "make check" just run the
tests, but yeah, it might be more useful for "make check" to setup an
empty database, then run the tests. I'm not quite sure yet.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-22 22:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21 17:42 [bug#37855] [PATCH] gnu: guix-data-service: Enable build time tests Christopher Baines
2019-10-22 16:17 ` Ludovic Courtès
2019-10-22 22:08   ` bug#37855: " Christopher Baines

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).