GNU bug report logs - #50035
[PATCH 1/3] gnu: go-github-com-godbus-dbus: Update to 5.0.4.

Previous Next

Package: guix-patches;

Reported by: Sarah Morgensen <iskarian <at> mgsn.dev>

Date: Fri, 13 Aug 2021 03:08:02 UTC

Severity: normal

Tags: patch

Done: Sharlatan Hellseher <sharlatanus <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: 50035 <at> debbugs.gnu.org
Subject: [bug#50035] [PATCH 3/3] gnu: go-github-com-godbus-dbus-v5: Fix and enable tests.
Date: Thu, 12 Aug 2021 20:12:59 -0700
Disable system D-Bus tests.  Fix session D-Bus tests by running them
within our own session.

* gnu/packages/golang.scm (go-github-com-godbus-dbus-v5)[source]: Add
snippet to disable system D-Bus tests.
[arguments]: Enable tests, override 'check phase to run tests within a
dbus session.
---
 gnu/packages/golang.scm | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 359c5a987d..28ead635f2 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -7431,13 +7431,27 @@ and @code{ioutil} packages that is easy to test.")
                     (url "https://github.com/godbus/dbus")
                     (commit (string-append "v" version))))
               (file-name (git-file-name name version))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; Disable tests which require a system D-Bus instance.
+                  (substitute* "conn_test.go"
+                    (("func TestSystemBus")
+                     "func DisabledTestSystemBus")
+                    (("func TestConnectSystemBus")
+                     "func DisabledTestConnectSystemBus"))))
               (sha256
                (base32
                 "0znax8kskb5gmp5fj75w56bc9p7b22wrdswzlh4d04sprlc471yi"))))
     (build-system go-build-system)
     (arguments
-     `(#:tests? #f ;no /var/run/dbus/system_bus_socket
-       #:import-path "github.com/godbus/dbus"))
+     `(#:import-path "github.com/godbus/dbus"
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? import-path #:allow-other-keys)
+             (when tests?
+               (invoke "dbus-run-session" "--" "go" "test" import-path)))))))
     (native-inputs
      `(("dbus" ,dbus))) ;dbus-launch
     (home-page "https://github.com/godbus/dbus/")
-- 
2.31.1





This bug report was last modified 257 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.