[PATCH 0/2] Fix tests to prepare for guix package upgrade

  • Done
  • quality assurance status badge
Details
3 participants
  • Josselin Poiret
  • Ludovic Courtès
  • Simon Tournier
Owner
unassigned
Submitted by
Josselin Poiret
Severity
normal
J
J
Josselin Poiret wrote on 25 Apr 2023 22:00
(address . guix-patches@gnu.org)(name . Josselin Poiret)(address . dev@jpoiret.xyz)
cover.1682452738.git.dev@jpoiret.xyz
Hello everyone,

This should fix both failing tests that otherwise prevent us from upgrading
the `guix` package. The latter will follow once these commits land into
master.

Best,

Josselin Poiret (2):
tests: guix-build.sh: Don't use hidden gcc for transformation tests.
tests: guix-graph.sh: Fix expected path from emacs to libffi.

tests/guix-build.sh | 6 +++---
tests/guix-graph.sh | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)


base-commit: 72b1c9713b8272add8bd9fb9e7f5246b39ba6db2
--
2.39.2
J
J
Josselin Poiret wrote on 25 Apr 2023 22:16
[PATCH 1/2] tests: guix-build.sh: Don't use hidden gcc for transformation tests.
9883e0aa75c73f5fc12c9e5b1fe358e9d66b966c.1682452738.git.dev@jpoiret.xyz
* tests/guix-build.sh: Do not try to rewrite gcc, it is hidden and so will not
be rewritten, as per eee95b5a879b7096dffd533f24107cf8926b621e. Instead, try
to build grep with coreutils rewritten to hello.
---
tests/guix-build.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (20 lines)
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index 2c59177c86..317c58ac42 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -318,10 +318,10 @@ drv2=`guix build inkscape -d --no-grafts --with-graft=glib=glib-networking`
test "$drv1" = "$drv2"
# Rewriting implicit inputs.
-drv1=`guix build hello -d`
-drv2=`guix build hello -d --with-input=gcc=gcc-toolchain`
+drv1=`guix build grep -d`
+drv2=`guix build grep -d --with-input=coreutils=hello`
test "$drv1" != "$drv2"
-guix gc -R "$drv2" | grep `guix build -d gcc-toolchain`
+guix gc -R "$drv2" | grep `guix build -d hello`
guix build guile --with-input=libunistring=something-really-silly && false
--
2.39.2
J
J
Josselin Poiret wrote on 25 Apr 2023 22:16
[PATCH 2/2] tests: guix-graph.sh: Fix expected path from emacs to libffi.
17cedc45c05d54f39d47bac3bbcd51a2ebae5a39.1682452738.git.dev@jpoiret.xyz
* tests/guix-graph.sh: Change the expected path from emacs to libffi. `guix
graph --path` outputs only one possible path, and the one it outputs for this
case has changed.
---
tests/guix-graph.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/tests/guix-graph.sh b/tests/guix-graph.sh
index 9824c6a65a..37ea0a7b8c 100644
--- a/tests/guix-graph.sh
+++ b/tests/guix-graph.sh
@@ -87,7 +87,7 @@ guix graph --path emacs vim && false
path="\
emacs
gnutls
-guile
+p11-kit
libffi"
test "`guix graph --path emacs libffi | cut -d '@' -f1`" = "$path"
--
2.39.2
L
L
Ludovic Courtès wrote on 28 Apr 2023 19:52
Re: bug#63074: [PATCH 0/2] Fix tests to prepare for guix package upgrade
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 63074-done@debbugs.gnu.org)
871qk3uc6c.fsf@gnu.org
Hi,

Josselin Poiret <dev@jpoiret.xyz> skribis:

Toggle quote (3 lines)
> tests: guix-build.sh: Don't use hidden gcc for transformation tests.
> tests: guix-graph.sh: Fix expected path from emacs to libffi.

Applied, thanks!

Ludo’.
Closed
S
S
Simon Tournier wrote on 16 May 2023 14:57
Re: [bug#63074] [PATCH 2/2] tests: guix-graph.sh: Fix expected path from emacs to libffi.
868rdo77tq.fsf@gmail.com
Hi Josselin,

On Tue, 25 Apr 2023 at 22:16, Josselin Poiret via Guix-patches via <guix-patches@gnu.org> wrote:
Toggle quote (20 lines)
> * tests/guix-graph.sh: Change the expected path from emacs to libffi. `guix
> graph --path` outputs only one possible path, and the one it outputs for this
> case has changed.
> ---
> tests/guix-graph.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/guix-graph.sh b/tests/guix-graph.sh
> index 9824c6a65a..37ea0a7b8c 100644
> --- a/tests/guix-graph.sh
> +++ b/tests/guix-graph.sh
> @@ -87,7 +87,7 @@ guix graph --path emacs vim && false
> path="\
> emacs
> gnutls
> -guile
> +p11-kit
> libffi"
> test "`guix graph --path emacs libffi | cut -d '@' -f1`" = "$path"

Hum, that’s annoying. Well, indeed “guix graph --path” returns one of
the shortest paths. And this result depends on how the graph is built
and then walked. That’s deterministic (should be!) but can depend on
the Guix revision.

Well, does it make sense to check the equality of such specific path?

Maybe, instead the test could check some invariant property. For
instance, that the length of the path between two packages must be the
same as between the same packages but with a package transformation
(replacement or else).

Or some others. For example, that the length from A to C is equal to the
length from A to B added to the length from B to C.

WDYT?

Cheers,
simon
?