summaryrefslogtreecommitdiff
path: root/gnu/packages/prometheus.scm
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2024-09-13 22:00:22 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-11-09 21:33:42 +0000
commit449fa18bf60907a7625ff6eeb037ecbb3a00be77 (patch)
treed196d15334c22818bd305ee08c298a5f73707555 /gnu/packages/prometheus.scm
parentf40fde0e85da80c6801f5affbd52e6cb84625eec (diff)
gnu: go-github-com-prometheus-exporter-toolkit: Fix build.
* gnu/packages/prometheus.scm (go-github-com-prometheus-exporter-toolkit): Fix build [arguments]: <#:phases>: Add 'fix-embed-editions-defaults-binpb phase; remove 'disable-failing-tests in favor of "-skip" test flags. [native-inputs]: Add go-google-golang-org-protobuf. Change-Id: If573aa261adc3a136a4907267d1427a9f9cfb4d9
Diffstat (limited to 'gnu/packages/prometheus.scm')
-rw-r--r--gnu/packages/prometheus.scm29
1 files changed, 21 insertions, 8 deletions
diff --git a/gnu/packages/prometheus.scm b/gnu/packages/prometheus.scm
index 6204eba5df2..c3267a234ba 100644
--- a/gnu/packages/prometheus.scm
+++ b/gnu/packages/prometheus.scm
@@ -405,20 +405,33 @@ from the default AWS credential chain.")
405 #:import-path "github.com/prometheus/exporter-toolkit" 405 #:import-path "github.com/prometheus/exporter-toolkit"
406 #:phases 406 #:phases
407 #~(modify-phases %standard-phases 407 #~(modify-phases %standard-phases
408 (add-after 'unpack 'disable-failing-tests 408 (add-after 'unpack 'fix-embed-editions-defaults-binpb
409 (lambda* (#:key tests? import-path #:allow-other-keys) 409 (lambda _
410 (with-directory-excursion (string-append "src/" import-path) 410 (let* ((import-path "google.golang.org/protobuf")
411 (substitute* (find-files "." "\\_test.go$") 411 (subdir "internal/editiondefaults")
412 ;; Some tests require network set up. 412 (embed-file "editions_defaults.binpb")
413 (("TestServerBehaviour") "OffTestServerBehaviour") 413 (embed-file-path
414 (("TestConfigReloading") "OffTestConfigReloading"))))) 414 (string-append "src/"
415 import-path "/"
416 subdir "/"
417 embed-file)))
418 (delete-file-recursively embed-file-path)
419 (copy-file
420 (string-append
421 #$(this-package-native-input "go-google-golang-org-protobuf")
422 "/" embed-file-path)
423 embed-file-path))))
415 ;; XXX: Workaround for go-build-system's lack of Go modules support. 424 ;; XXX: Workaround for go-build-system's lack of Go modules support.
416 (delete 'build) 425 (delete 'build)
417 (replace 'check 426 (replace 'check
418 (lambda* (#:key tests? import-path #:allow-other-keys) 427 (lambda* (#:key tests? import-path #:allow-other-keys)
419 (when tests? 428 (when tests?
420 (with-directory-excursion (string-append "src/" import-path) 429 (with-directory-excursion (string-append "src/" import-path)
421 (invoke "go" "test" "-v" "./...")))))))) 430 (invoke "go" "test" "-v"
431 "-skip" "TestServerBehaviour|TestConfigReloading"
432 "./..."))))))))
433 (native-inputs
434 (list go-google-golang-org-protobuf))
422 (propagated-inputs 435 (propagated-inputs
423 (list go-github-com-alecthomas-kingpin-v2 436 (list go-github-com-alecthomas-kingpin-v2
424 go-github-com-coreos-go-systemd-v22 437 go-github-com-coreos-go-systemd-v22