gnu: go-github-com-jdkato-twine: Enable tests.
* gnu/packages/golang-xyz.scm (go-github-com-jdkato-twine) [source]: Add snippet adjusting changed upstream module import path. [arguments]: <#:phases>: Remove 'build and 'patch-module-import-path phases. Add 'disable-failing-tests phase. Use custom 'check phase. Change-Id: I8553705ca0b812c772005460b242ce47b0c65cedmaster
parent
f1af3a542c
commit
93fb74c2ed
|
@ -2644,33 +2644,33 @@ and stop units of work, which may receive @code{Close} signals from many clients
|
||||||
(commit (string-append "v" version))))
|
(commit (string-append "v" version))))
|
||||||
(file-name (git-file-name name version))
|
(file-name (git-file-name name version))
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "1hbpxcrcsbi975lklrhzyzk0fzn79pxicvfyf2sckmd2n6jb4ayy"))))
|
(base32 "1hbpxcrcsbi975lklrhzyzk0fzn79pxicvfyf2sckmd2n6jb4ayy"))
|
||||||
|
(modules '((guix build utils)))
|
||||||
|
(snippet
|
||||||
|
#~(begin
|
||||||
|
;; Module name has been changed upstream.
|
||||||
|
(substitute* (find-files "." "\\.go$")
|
||||||
|
(("gopkg.in/neurosnap/sentences.v1")
|
||||||
|
"github.com/neurosnap/sentences"))))))
|
||||||
(build-system go-build-system)
|
(build-system go-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
;; FIXME: Adjust tests sute or check with upstram:
|
|
||||||
;; === Failed
|
|
||||||
;; === FAIL: nlp/segment TestGoldenRules (0.00s)
|
|
||||||
;; segment_test.go:143: 25. Double quotations inside sentence
|
|
||||||
;; segment_test.go:144: Actual: [She turned to him, "This is great." she said.]
|
|
||||||
;; segment_test.go:145: Actual: 2, Expected: 1
|
|
||||||
;; segment_test.go:146: ===
|
|
||||||
#:tests? #f
|
|
||||||
#:import-path "github.com/jdkato/twine"
|
#:import-path "github.com/jdkato/twine"
|
||||||
#:phases
|
#:phases
|
||||||
#~(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-after 'unpack 'patch-module-import-path
|
(add-after 'unpack 'disable-failing-tests
|
||||||
(lambda* (#:key import-path #:allow-other-keys)
|
(lambda* (#:key tests? import-path #:allow-other-keys)
|
||||||
(with-directory-excursion (string-append "src/" import-path)
|
(with-directory-excursion (string-append "src/" import-path)
|
||||||
(substitute* (find-files "." "\\.go$")
|
(substitute* "nlp/segment/segment_test.go"
|
||||||
(("gopkg.in/neurosnap/sentences.v1")
|
(("TestGoldenRules") "OffTestGoldenRules")))))
|
||||||
"github.com/neurosnap/sentences")))))
|
;; XXX: Workaround for go-build-system's lack of Go modules
|
||||||
(replace 'build
|
;; support.
|
||||||
(lambda* (#:key import-path #:allow-other-keys)
|
(delete 'build)
|
||||||
(with-directory-excursion (string-append "src/" import-path)
|
(replace 'check
|
||||||
(invoke "go" "build" "-v" "-x" "-ldflags=-s -w" "-trimpath" "./...")))))))
|
(lambda* (#:key tests? import-path #:allow-other-keys)
|
||||||
(native-inputs
|
(when tests?
|
||||||
(list gotestsum))
|
(with-directory-excursion (string-append "src/" import-path)
|
||||||
|
(invoke "go" "test" "-v" "./..."))))))))
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
(list go-github-com-montanaflynn-stats
|
(list go-github-com-montanaflynn-stats
|
||||||
go-github-com-neurosnap-sentences
|
go-github-com-neurosnap-sentences
|
||||||
|
|
Reference in New Issue