aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/golang-build.scm
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2024-07-20 08:34:26 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-07-25 21:00:58 +0100
commit4714623e05dd645c98554f90899d22f26f77d33d (patch)
tree24505bee19c264f94b5e403f8b714e528497d019 /gnu/packages/golang-build.scm
parent96998167c26cddbf44129cbf9955871b3fedaee9 (diff)
downloadguix-4714623e05dd645c98554f90899d22f26f77d33d.tar
guix-4714623e05dd645c98554f90899d22f26f77d33d.tar.gz
gnu: go-golang-org-x-exp: Enable tests.
* gnu/packages/golang-build.scm (go-golang-org-x-exp): Enable tests. [arguments]: <#:phases>: Add 'remove-failing-tests phase. Use custom 'check phase. [propagated-inputs]: Add go-github-com-google-go-cmp, go-golang-org-x-mod, and go-golang-org-x-tools. Change-Id: Ic1573969572d32bb7318ed73135c853f42338f86
Diffstat (limited to 'gnu/packages/golang-build.scm')
-rw-r--r--gnu/packages/golang-build.scm30
1 files changed, 26 insertions, 4 deletions
diff --git a/gnu/packages/golang-build.scm b/gnu/packages/golang-build.scm
index d1977d36c8..a8f4cbeb20 100644
--- a/gnu/packages/golang-build.scm
+++ b/gnu/packages/golang-build.scm
@@ -277,10 +277,32 @@ language.")
(arguments
(list
#:import-path "golang.org/x/exp"
- ;; Source-only package
- #:tests? #f
- #:phases #~(modify-phases %standard-phases
- (delete 'build))))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'remove-failing-tests
+ (lambda* (#:key import-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/" import-path)
+ ;; Benchmark requires other modules to pass tests, delete them.
+ (delete-file-recursively "slog/benchmarks")
+ (substitute* (find-files "." "\\_test.go$")
+ ;; Disable failing tests: error running `go mod init`: go:
+ ;; modules disabled by GO111MODULE=off; see 'go help modules'
+ ;; , exit status 1
+ (("TestFailure") "OffTestFailure")
+ (("TestRelease_gitRepo_uncommittedChanges")
+ "OffTestRelease_gitRepo_uncommittedChanges")))))
+ ;; XXX: Workaround for go-build-system's lack of Go modules
+ ;; support.
+ (delete 'build)
+ (replace 'check
+ (lambda* (#:key tests? import-path #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion (string-append "src/" import-path)
+ (invoke "go" "test" "-v" "./..."))))))))
+ (propagated-inputs
+ (list go-github-com-google-go-cmp
+ go-golang-org-x-mod
+ go-golang-org-x-tools))
(home-page "https://golang.org/x/exp")
(synopsis "Experimental and deprecated Go packages")
(description