[PATCH] gnu: guix-data-service: Enable build time tests.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal
C
C
Christopher Baines wrote on 21 Oct 2019 19:42
(address . guix-patches@gnu.org)
20191021174223.28196-1-mail@cbaines.net
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(-)

Toggle diff (28 lines)
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
L
L
Ludovic Courtès wrote on 22 Oct 2019 18:17
(name . Christopher Baines)(address . mail@cbaines.net)(address . 37855@debbugs.gnu.org)
87zhhsycua.fsf@gnu.org
Hi,

Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (8 lines)
> 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’.
C
C
Christopher Baines wrote on 23 Oct 2019 00:08
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 37855-done@debbugs.gnu.org)
874l00qvpr.fsf@cbaines.net
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (14 lines)
> 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.

Toggle quote (3 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl2vffBfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9Xfs4w//RfJPmZncbmcSqct9h1uLUzeQ0u/0ciewYU23DPslnxQo0a9XOZ2jO7i9
toqZPoPsMSMvZXyhljg4lawyp0yav9VdN7JTrbrVPFCqaJvTJFHfqVuHQfhjtmzq
ltyvpPPS56zB/NLbfP4acPCRX6iLUEogZoc/N27IPOll9TDfoJh6Y14MVBgTG001
YUJUHE4c6/E75nKwJyDby3vhQef0o+X1JiJZOD1UJXGVl23U5ZGkb3GZJml4RvdU
j8eZ0iADfwzaxZfEAmMTA6hWHDaGD2ZfCmyNRkWWvenrJpXSN6BTbMswxxa6DSX4
d/CwMBTNtyC7PqVO3s4mkGB4nBY1P1Vi34hn2ubcft2nXze5rxrJOgfejGznreCD
//Az6KwaSA64FoCdPjFZycxo5fAVpo+k9U5x6CHDtNWpSBKPh07OLvuHkhGbZSOM
IJSf9rsJEChgdGV9YgLPvwukgS2FY325hjJ4vjrpuXbqHU6JuS0XHv3zUEpbdhL9
RtBHZy47pmbACLethVm1GgPDVX82BVMRT6+9lpCd1zSQpBBkBdzGL16WDc5KWISI
uuaoyFlqiliZV5ohxawp+hWBs1BDMDrSroyCkdl17D0cFfVZdN25HxHO+WMmt55P
B+XAw/iB7LBNbHGF1ihs+jeQIPKoZRAFXGGNC5koY9HxjNQH7tY=
=ecW1
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 37855@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 37855
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch