sharlatan pushed a commit to branch go-team
in repository guix.

commit 3a97fb01583574e6c584b5b814129bc5bd6b4d9a
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Sun Dec 29 16:14:31 2024 +0000

    gnu: vale: Simplify.
    
    * gnu/packages/textutils.scm (vale): Simplify.
    [arguments] <test-flags>: Move skipped tests here.
    <phases>: Use default 'check, add 'pre-check.
    
    Change-Id: I133f6c6763d4643b595ffddec85a3bf7ad1d24fe
---
 gnu/packages/textutils.scm | 41 ++++++++++++++++++-----------------------
 1 file changed, 18 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm
index 5c0a4ad9a5..cb8a25be75 100644
--- a/gnu/packages/textutils.scm
+++ b/gnu/packages/textutils.scm
@@ -1519,31 +1519,26 @@ of a Unix terminal to HTML code.")
       #:embed-files #~(list ".*\\.gob")
       #:import-path "github.com/errata-ai/vale/cmd/vale"
       #:unpack-path "github.com/errata-ai/vale"
+      ;; Disable tests requring network access: Get
+      ;; 
"https://raw.githubusercontent.com/errata-ai/styles/master/library.json":
+      ;; dial tcp: lookup raw.githubusercontent.com on [::1]:53: read udp
+      ;; [::1]:52621->[::1]:53: read: connection refused.
+      #:test-flags
+      #~(list "-skip"
+              (string-join
+               (list "TestLibrary"
+                     "TestLocalComplete"
+                     "TestLocalDir"
+                     "TestLocalOnlyStyles"
+                     "TestLocalZip"
+                     "TestNoPkgFound"
+                     "TestV3Pkg")
+               "|"))
       #:phases
       #~(modify-phases %standard-phases
-          ;; Disable tests requring network access: Get
-          ;; 
"https://raw.githubusercontent.com/errata-ai/styles/master/library.json":
-          ;; dial tcp: lookup raw.githubusercontent.com on [::1]:53:
-          ;; read udp [::1]:52621->[::1]:53: read: connection refused.
-          (add-after 'unpack 'disable-failing-tests
-            (lambda* (#:key tests? unpack-path #:allow-other-keys)
-              (with-directory-excursion (string-append "src/" unpack-path)
-                (substitute* (find-files "." "\\_test.go$")
-                  (("TestLibrary") "OffTestLibrary")
-                  (("TestLocalComplete") "OffTestLocalComplete")
-                  (("TestLocalDir") "OffTestLocalDir")
-                  (("TestLocalOnlyStyles") "OffTestLocalOnlyStyles")
-                  (("TestLocalZip") "OffTestLocalZip")
-                  (("TestNoPkgFound") "OffTestNoPkgFound")
-                  (("TestV3Pkg") "OffTestV3Pkg")))))
-          ;; XXX: Workaround for go-build-system's lack of Go modules
-          ;; support.
-          (replace 'check
-            (lambda* (#:key tests? unpack-path #:allow-other-keys)
-              (when tests?
-                (with-directory-excursion (string-append "src/" unpack-path)
-                  (setenv "HOME" "/tmp")
-                  (invoke "go" "test" "-v" "./..."))))))))
+          (add-before 'check 'pre-check
+            (lambda _
+              (setenv "HOME" "/tmp"))))))
     (native-inputs
      (list go-github-com-masterminds-sprig-v3
            go-github-com-adrg-strutil

Reply via email to