~ruther/guix-local

0e649f3631b03d4cfda2785dea798af6dbe3e4c5 — Vinicius Monego 10 months ago 2774ef1
gnu: deluge: Enable tests.

* gnu/packages/bittorrent.scm (deluge)[native-inputs]: Add
python-pytest, python-pytest-twisted, xorg-server-for-tests.
[arguments]: Remove '#:tests? #f'.
<#:test-flags>: Skip failing tests.
<#:phases>: Add phase 'pre-check' before 'check'.

Change-Id: I32e0f4d5d580535834261c15925003bf813ec035
1 files changed, 32 insertions(+), 7 deletions(-)

M gnu/packages/bittorrent.scm
M gnu/packages/bittorrent.scm => gnu/packages/bittorrent.scm +32 -7
@@ 81,6 81,7 @@
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-build)
  #:use-module (gnu packages python-check)
  #:use-module (gnu packages python-crypto)
  #:use-module (gnu packages python-web)
  #:use-module (gnu packages python-xyz)


@@ 90,7 91,8 @@
  #:use-module (gnu packages tls)
  #:use-module (gnu packages version-control)
  #:use-module (gnu packages web)
  #:use-module (gnu packages xml))
  #:use-module (gnu packages xml)
  #:use-module (gnu packages xorg))

(define-public transmission
  (package


@@ 630,19 632,42 @@ the following features:
           python-twisted
           python-zope-interface))
    (native-inputs
     (list intltool python-setuptools python-wheel))
     (list intltool
           python-pytest
           python-pytest-twisted
           python-setuptools
           python-wheel
           xorg-server-for-tests))
    (native-search-paths
     (list $SSL_CERT_DIR
           $SSL_CERT_FILE))
    ;; TODO: Enable tests.
    ;; After "pytest-twisted" is packaged, HOME is set, and an X server is
    ;; started, some of the tests still fail.  There are likely some tests
    ;; that require a network connection.
    (arguments
     (list
      #:tests? #f
      #:test-flags
      #~(list "-m" "not internet and not slow" ;; Ignore these markers.
              "-k" (string-append "not "
                                  (string-join
                                   ;; Tests below require a running daemon.
                                   (list "TestClient"
                                         "TestJSON"
                                         "TestJSONCustomUserCase"
                                         "TestRPCRaiseDelugeErrorJSON"
                                         "TestConsoleScriptEntryWithDaemon"
                                         ;; These need a connection.
                                         "TestWebAPI"
                                         "TestWebServer"
                                         ;; These failed with AssertionError.
                                         "test_is_interface_name"
                                         "test_is_interface")
                                   " and not ")))
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'check 'pre-check
            (lambda _
              ;; Setup X server for tests and a writable HOME.
              (system "Xvfb &")
              (setenv "DISPLAY" ":0")
              (setenv "HOME" "/tmp")))
          (add-before 'wrap 'wrap-deluge
            (lambda _
              (for-each