mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-23 11:09:41 -05:00
gnu: go-github-com-prometheus-procfs: Enable tests.
* gnu/packages/prometheus.scm (go-github-com-prometheus-procfs): Enable tests. [arguments] <#:phases>: Add 'unpack-testdata and 'remove-testdata phases. Use custom 'check phase. Change-Id: Iae01ce9cb57748ce4b155e2b814dd69ff9ba5114
This commit is contained in:
parent
0e8fd31a3d
commit
0fc1ce6f4f
1 changed files with 16 additions and 3 deletions
|
@ -399,9 +399,22 @@ (define-public go-github-com-prometheus-procfs
|
|||
(arguments
|
||||
(list
|
||||
#:import-path "github.com/prometheus/procfs"
|
||||
;; The tests require Go modules, which are not yet supported in Guix's
|
||||
;; Go build system.
|
||||
#:tests? #f))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-before 'check 'unpack-testdata
|
||||
(lambda* (#:key tests? import-path #:allow-other-keys)
|
||||
(with-directory-excursion (string-append "src/" import-path)
|
||||
(invoke "./ttar" "-C" "testdata/" "-x" "-f" "testdata/fixtures.ttar"))))
|
||||
;; XXX: Replace when go-build-system supports nested path.
|
||||
(replace 'check
|
||||
(lambda* (#:key import-path tests? #:allow-other-keys)
|
||||
(when tests?
|
||||
(with-directory-excursion (string-append "src/" import-path)
|
||||
(invoke "go" "test" "-v" "./...")))))
|
||||
(add-after 'check 'remove-testdata
|
||||
(lambda* (#:key tests? import-path #:allow-other-keys)
|
||||
(with-directory-excursion (string-append "src/" import-path)
|
||||
(delete-file-recursively "testdata")))))))
|
||||
(propagated-inputs
|
||||
(list go-github-com-google-go-cmp
|
||||
go-golang-org-x-sync
|
||||
|
|
Loading…
Reference in a new issue