diff options
author | Sharlatan Hellseher <sharlatanus@gmail.com> | 2024-08-25 17:35:26 +0100 |
---|---|---|
committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2024-08-25 20:46:49 +0100 |
commit | 0fc1ce6f4f7c2987525addb8cba022d0b0830e99 (patch) | |
tree | 2e2f90ccd54659f9d199e1a3c97fa766b18e05ed /gnu | |
parent | 0e8fd31a3d07ae491fff5c0e468cbe58454d6b7d (diff) | |
download | guix-0fc1ce6f4f7c2987525addb8cba022d0b0830e99.tar guix-0fc1ce6f4f7c2987525addb8cba022d0b0830e99.tar.gz |
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
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/packages/prometheus.scm | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gnu/packages/prometheus.scm b/gnu/packages/prometheus.scm index d1387af9aa..449086c566 100644 --- a/gnu/packages/prometheus.scm +++ b/gnu/packages/prometheus.scm @@ -399,9 +399,22 @@ from the default AWS credential chain.") (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 |