From c293aa1d6f41dc3dbe904dccb44b6177eb1e16e1 Mon Sep 17 00:00:00 2001 From: Sarah Morgensen Date: Thu, 29 Aug 2024 01:02:52 +0100 Subject: gnu: go-github-com-godbus-dbus: Enable tests. * gnu/packages/golang.scm (go-github-com-godbus-dbus): Enable tests. [arguments] <#:phases>: Add 'disable-failing-tests phase. Override 'check phase to run tests within a dbus session. Change-Id: Ib27d33363d4d7071e91380588413ae035ae9609f Co-authored-by: Sharlatan Hellseher Signed-off-by: Sharlatan Hellseher --- 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 381acd0853..648f5c1733 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -6666,8 +6666,22 @@ RFC-5802 and RFC-7677.") "0h0cl1r136g0kxbw3i7ggb9mhavpi1yr7d7312iwhkxm93dxkphg")))) (build-system go-build-system) (arguments - `(#:tests? #f ;no /var/run/dbus/system_bus_socket - #:import-path "github.com/godbus/dbus")) + (list + #:import-path "github.com/godbus/dbus" + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'disable-failing-tests + (lambda* (#:key tests? unpack-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" unpack-path) + (substitute* (find-files "." "\\_test.go$") + ;; Disable tests which require a system D-Bus instance. + (("TestSystemBus") "OffTestSystemBus") + (("TestConnectSystemBus") "OffTestConnectSystemBus"))))) + (replace 'check + (lambda* (#:key tests? import-path #:allow-other-keys) + (when tests? + (with-directory-excursion (string-append "src/" import-path) + (invoke "dbus-run-session" "--" "go" "test" "./...")))))))) (native-inputs (list dbus)) ;dbus-launch (home-page "https://github.com/godbus/dbus/") -- cgit v1.2.3