all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Cyril Roelandt <tipecaml@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH 3/5] gnu: Enable tests in Python 3.
Date: Fri, 07 Mar 2014 10:40:51 +0100	[thread overview]
Message-ID: <878usm9wik.fsf@gnu.org> (raw)
In-Reply-To: <1394160455-32580-4-git-send-email-tipecaml@gmail.com> (Cyril Roelandt's message of "Fri, 7 Mar 2014 03:47:33 +0100")

Cyril Roelandt <tipecaml@gmail.com> skribis:

> * gnu/packages/python.scm: enable tests for Python 3
> * gnu/packages/python-fix-tests.patch: New file.
> * gnu/packages/gnu-sysem.am (dist_patch_DATA): add it.

Typo here.

> diff --git a/gnu/packages/patches/python-fix-tests.patch b/gnu/packages/patches/python-fix-tests.patch
> new file mode 100644
> index 0000000..23ef17f
> --- /dev/null
> +++ b/gnu/packages/patches/python-fix-tests.patch
> @@ -0,0 +1,62 @@
> +--- Lib/test/test_shutil.py	2014-03-01 04:56:37.768311000 +0100
> ++++ Lib/test/test_shutil.py	2014-03-01 03:02:36.088311000 +0100
> +@@ -1053,7 +1053,6 @@
> +         self.assertRaises(ValueError, make_archive, base_name, 'xxx')
> +

Could you add a couple of lines of summary and (possibly) and a link to
the upstream report/discussion (or a statement on the upstream status)?

> +     @requires_zlib
> +-    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")

It seems that this part of the patch is reversed, no?

> +--- Lib/test/test_posixpath.py	2014-03-01 05:46:56.984311000 +0100
> ++++ Lib/test/test_posixpath.py	2014-03-01 06:20:50.704311000 +0100
> +@@ -319,7 +319,11 @@
> +                 del env['HOME']
> +                 home = pwd.getpwuid(os.getuid()).pw_dir
> +                 # $HOME can end with a trailing /, so strip it (see #17809)
> +-                self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))
> ++		# The Guix builders have '/' as a home directory, so
> ++		# home.rstrip("/") will be an empty string and the test will
> ++		# fail. Let's just disable it since it does not really make
> ++		# sense with such a bizarre setup.
> ++                # self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))

I see that the recipe’s ‘pre-check’ phase does:

  (setenv "HOME" (getcwd))

so $HOME should actually be /tmp/nix-build-xxx, not just /, no?

> +--- Lib/test/test_socket.py	2014-03-02 22:14:12.264311000 +0100
> ++++ Lib/test/test_socket.py	2014-03-03 01:12:21.360311000 +0100
> +@@ -819,6 +819,8 @@
> +             self.assertRaises(OverflowError, socket.htonl, k)
> +             self.assertRaises(OverflowError, socket.htons, k)
> +
> ++    @unittest.skipUnless(os.path.exists("/etc/services"),
> ++                         "getservbyname uses /etc/services, which is not in the chroot")

(I think that should go upstream.)

> ++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
> ++                         "getaddrinfo uses /etc/gai.conf, which is not in the chroot")

I don’t think gai.conf is the problem.  Instead, the problem is that one
cannot rely on name lookups in the build environment at all, and even in
general.

So this patch may be OK for ourselves (except the comment), but upstream
Python should really just gracefully skip the test if name lookup
fails.

> +    (arguments
> +     (let ((args `(#:modules ((guix build gnu-build-system)
> +                              (guix build utils)
> +                              (srfi srfi-1)
> +                              (srfi srfi-26))
> +                   ,@(package-arguments python-2))))
> +       (substitute-keyword-arguments args
> +         ((#:tests? _)
> +          `(list #t)))))

#t instead of `(list #t) should do the job.  :-)

Thanks for going through all this!

Ludo’.

  reply	other threads:[~2014-03-07  9:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07  2:47 [PATCH 0/5] Python improvements Cyril Roelandt
2014-03-07  2:47 ` [PATCH 1/5] gnu: Enable the 'ctypes' module in Python Cyril Roelandt
2014-03-07  9:28   ` Ludovic Courtès
2014-03-07  2:47 ` [PATCH 2/5] gnu: Python: use /nix/.../sh if /bin/sh cannot be found Cyril Roelandt
2014-03-07  9:31   ` Ludovic Courtès
2014-03-22  3:36     ` [PATCH 2/4 v2] gnu: Python: use /nix/.../sh instead of /bin/sh in the subprocess module Cyril Roelandt
2014-03-22 14:26       ` Ludovic Courtès
2014-03-07  2:47 ` [PATCH 3/5] gnu: Enable tests in Python 3 Cyril Roelandt
2014-03-07  9:40   ` Ludovic Courtès [this message]
2014-03-21  4:12     ` [PATCH 3/4 v2] " Cyril Roelandt
2014-03-22 14:32       ` Ludovic Courtès
2014-03-21  4:14     ` [PATCH 3/5] " Cyril Roelandt
2014-03-21 13:15       ` Ludovic Courtès
2014-03-22 23:13         ` Cyril Roelandt
2014-03-23 10:43           ` Ludovic Courtès
2014-03-07  2:47 ` [PATCH 4/5] gnu: Python: bump to 3.3.4 Cyril Roelandt
2014-03-07  9:31   ` Ludovic Courtès
2014-03-21  4:07     ` Cyril Roelandt
2014-03-21 13:02       ` Ludovic Courtès
2014-03-07  2:47 ` [PATCH 5/5] gnu: remove python-fix-dbm.patch Cyril Roelandt
2014-03-07  9:32   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878usm9wik.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=tipecaml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.