[PATCH] Remove duplication in tests/publish.scm

  • Open
  • quality assurance status badge
Details
One participant
  • Maxime Devos
Owner
unassigned
Submitted by
Maxime Devos
Severity
normal
M
M
Maxime Devos wrote on 31 Jan 2021 19:46
(address . guix-patches@gnu.org)
b5f02cfda1b0586c32ce5a8610b4e490a637c552.camel@telenet.be
Hi Guix!

a draft patch for adding a ‘hook’ mechanism to
guix publish. Now I would like to write some tests.

However, it seems the following construct is duplicated
for many tests:

(call-with-new-thread
(lambda ()
(guix-publish "--port=PORT" et cetera)))
This patch series introduces some abstraction.
Currently, there is only one patch yet, but more
will follow.

"make check TESTS=tests/publish.scm" still succeeds.
(Guix version: 23a5dcce1d893b8f5c5301ae3c1af863776ed3cf
with some not-yet-upstreamed changes).

Maxime
--
Maxime Devos <maximedevos@telenet.be>
PGP Key: C1F3 3EE2 0C52 8FDB 7DD7 011F 49E3 EE22 1917 25EE
Freenode handle: mdevos
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYBb66hccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pEWAQD9nLiw29CIsTc4KpAlUfMIrGoq
7fYpZuZEH5H1eAm/eAEA11ZWWSiTWnnEQFtmiQ/8zh6XASBR3A6KWAQjgJt+qwY=
=mRp0
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 31 Jan 2021 19:52
1aba271c99c375ff9a308f350c0bd0802ee49f3e.camel@telenet.be
Oops, I forgot to attach the patch.
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYBb8YhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7leTAQC/TTBrwKGg9dbnOh5qGC/Ew0wo
yVhbCkP8IVx1PlaTZQEAqnXxKgqLZ2kuiYK9DygnyOXTFVXdKSrn4n5Riav0UAM=
=O8VW
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 31 Jan 2021 21:04
[PATCH] Remove duplication in tests/publish.scm
(address . 46216@debbugs.gnu.org)
22d53945012c235334fb1b37262c000fcb666838.camel@telenet.be
This is the second patch in the series. Description
from commit message:

* tests/publish.scm
(call-with-guix-publish, with-guix-publish): introduce
combination of spawn-guix-publish and wait-until-ready,
and adjust tests to use the macro.

Maxime
Attachment: file
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYBcNVxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pmaAP4uEAtWJYs7gjs4esHx37V4vvsp
0Tl+P+aKWdlD8oCJhAEAglXt5chQyQ3ICNAC9RXm2H+dR/DrGzAQHaG9EDVbywM=
=sacn
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 31 Jan 2021 23:01
(address . guix-patches@gnu.org)
077d7e5c5e6935fce1e816784a03e55eb274dc50.camel@telenet.be
This is the third patch in the series. Description
from patch:

This way, there's no risk of accidentally reusing a
port number used by another test. This changes the
workings of the "/*.narinfo for a compressed file" test
a little, by not reusing the port from the test
"/*.narinfo with compression".

* tests/publish.scm
(*latest-port*, call-with-guix-publish, with-guix-publish):
automatically assign port numbers, and change tests to
use the new calling rules.
Attachment: file
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYBcozBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kCtAP4u9nNFJUrU5C6t7Y70INXEryG/
aUMKVukepETKtb6rlgEAzj5w59Rzy6kPum+h6aJgcUj2cmw0pRviXRYGDf5JqgU=
=Sk1E
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 31 Jan 2021 23:10
(address . 46216@debbugs.gnu.org)
718d794296d6f47d127f88e77f39e9386b2185d4.camel@telenet.be
I accidentally sent this to guix-patches instead of
46216@debbugs.gnu.org.

-------- Forwarded Message --------
From: Maxime Devos <maximedevos@telenet.be>
Reply-To: 46216@debbugs.gnu.org
To: guix-patches@gnu.org
Subject: Re: [PATCH] Remove duplication in tests/publish.scm
Date: Sun, 31 Jan 2021 23:01:48 +0100

This is the third patch in the series. Description
from patch:

This way, there's no risk of accidentally reusing a
port number used by another test. This changes the
workings of the "/*.narinfo for a compressed file" test
a little, by not reusing the port from the test
"/*.narinfo with compression".

* tests/publish.scm
(*latest-port*, call-with-guix-publish, with-guix-publish):
automatically assign port numbers, and change tests to
use the new calling rules.
Attachment: file
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYBcq8RccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7odfAP9IA3ToqVWaI5cuS2qrrffb6PwY
PHj3+EQqTf+5fsiXDgD/VRrpvOuet8iszrG5D7L7zp0ONG/EPXmyUFDvOR8DPAo=
=5Ky+
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 1 Feb 2021 15:04
[PATCH] Remove duplication in tests/publish.scm
(address . 46216@debbugs.gnu.org)
92135424cd296e2e02f4f58a638da5cc6dcc1667.camel@telenet.be
This is the fourth patch in the series.
It removes any explicit port numbers in the test.
This may be useful for preventing some potential
future problems with parallel "make check".

Description from the commit message:

Toggle quote (8 lines)
> Subject: [PATCH 4/4] tests: publish: don't bind the test server to a port.
>
> This way, multiple instances of 'make check TESTS=tests/publish.scm'
> can be run in parallel. Also, there's no risk of the ports used
> in this test conflicting with ports assigned to system services
> anymore. This also prevents any potential future conflicts
> with ports used by other tests that would lead to nondeterministic
> test failures when parallel tests are enabled.
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYBgKYBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rc0AP40KXysVJJJY8SGfd2Dt7PsYKA9
SEA1G6qFu7aaPFtcWwEAhE2vvR07PnByvDqLoevKNDeQQM2bI/hkYS7kDWf8xQc=
=hvgi
-----END PGP SIGNATURE-----


?