From b60f731c68548e752195c7f9405756ca9f3e6ed5 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Tue, 3 Sep 2024 09:44:29 +0100 Subject: gnu: go-github-com-zalando-go-keyring: Enable tests. * gnu/packages/golang.scm (go-github-com-zalando-go-keyring) [arguments]: <#:phases>: Add 'disable-failing-tests phase, use custom 'check. [propagated-inputs]: Remove dbus. [native-inputs]: Add dbus. Change-Id: I06ba340ef936fef006b7b804688b2ca2863d00a2 --- gnu/packages/golang.scm | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 773529425e..95b5480406 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -6771,10 +6771,28 @@ formatting information, rather than the current locale name.") "1p6qlsbj9rmqiwz9ly4c7jmifcx8m45xjhsbdwdvw2jzw5jc2ch1")))) (build-system go-build-system) (arguments - `(#:tests? #f ;XXX: Fix dbus tests - #:import-path "github.com/zalando/go-keyring")) + (list + #:import-path "github.com/zalando/go-keyring" + #: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 DBus instance. + (("TestDelete") "OffTestDelete") + (("TestGet") "OffTestGet") + (("TestSet") "OffTestSet"))))) + (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" "-v" "./...")))))))) + (native-inputs + (list dbus)) (propagated-inputs - (list go-github-com-godbus-dbus-v5 dbus)) + (list go-github-com-godbus-dbus-v5)) (home-page "https://github.com/zalando/go-keyring/") (synopsis "Library for working with system keyring") (description "@code{go-keyring} is a library for setting, getting and -- cgit v1.2.3