guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

188/401: gnu: go-go-mongodb-org-mongo-driver: Simplify package.


From: guix-commits
Subject: 188/401: gnu: go-go-mongodb-org-mongo-driver: Simplify package.
Date: Thu, 26 Dec 2024 19:30:55 -0500 (EST)

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

commit 6aa6e1b9723d7c0a77c39b08ff1fd36ad5d267c9
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Sun Dec 15 18:48:36 2024 +0000

    gnu: go-go-mongodb-org-mongo-driver: Simplify package.
    
    * gnu/packages/golang-xyz.scm (go-go-mongodb-org-mongo-driver)
    [arguments]<test-flags>: Move skip logic here.
    <test-subdirs>: Move select subdir for tests here.
    <phases>: Remove 'disable-failing-tests. Use default 'check.
    
    Change-Id: I31f62fa92bf04090264541a4ed98f502e4a8a7da
---
 gnu/packages/golang-xyz.scm | 52 +++++++++++++++++----------------------------
 1 file changed, 20 insertions(+), 32 deletions(-)

diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index d692733c43..5326de2037 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -10575,46 +10575,34 @@ also provides V-style logging controlled by the 
@code{-v} and
     (arguments
      (list
       #:import-path "go.mongodb.org/mongo-driver"
+      #:test-flags
+      #~(list "-skip"
+              (string-join
+               ;; Some tests require running database and available network
+               ;; connection.
+               (list "TestAggregate"
+                     "TestPollSRVRecords"
+                     "TestPollSRVRecordsServiceName"
+                     "TestPollingSRVRecordsLoadBalanced"
+                     "TestPollingSRVRecordsSpec"
+                     "TestServerHeartbeatOffTimeout"
+                     "TestServerHeartbeatTimeout"
+                     "TestTimeCodec"
+                     "TestTopologyConstructionLogging"
+                     "TestURIOptionsSpec")
+               "|"))
+      #:test-subdirs
+      #~(list "bson/..." "event/..." "internal/..." "tag/..." "x/...")
       #:phases
       #~(modify-phases %standard-phases
+          (delete 'build) ; no go files in project's root
           (add-after 'unpack 'remove-examples-and-benchmarks
             (lambda* (#:key tests? import-path #:allow-other-keys)
               (with-directory-excursion (string-append "src/" import-path)
                 (for-each delete-file-recursively
                           (list "benchmark"
                                 "examples"
-                                "cmd/godriver-benchmark")))))
-          (add-before 'check 'disable-failing-tests
-            (lambda* (#:key tests? unpack-path #:allow-other-keys)
-              (with-directory-excursion (string-append "src/" unpack-path)
-                (substitute* (find-files "." "\\_test.go$")
-                  ;; Some tests require running database and available network 
connection.
-                  (("TestAggregate") "OffTestAggregate")
-                  (("TestPollSRVRecords") "OffTestPollSRVRecords")
-                  (("TestPollSRVRecordsServiceName")
-                   "OffTestPollSRVRecordsServiceName")
-                  (("TestPollingSRVRecordsLoadBalanced")
-                   "OffTestPollingSRVRecordsLoadBalanced")
-                  (("TestPollingSRVRecordsSpec")
-                   "OffTestPollingSRVRecordsSpec")
-                  (("TestServerHeartbeatOffTimeout")
-                   "OffTestServerHeartbeatTimeout")
-                  (("TestServerHeartbeatTimeout")
-                   "OffTestServerHeartbeatTimeout")
-                  (("TestTimeCodec") "OffTestTimeCodec")
-                  (("TestTopologyConstructionLogging")
-                   "OffTestTopologyConstructionLogging")
-                  (("TestURIOptionsSpec") "OffTestURIOptionsSpec")))))
-          ;; 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)
-                  (for-each
-                   (lambda (package)
-                     (invoke "go" "test" (string-append "./" package "/...")))
-                   (list "bson" "event" "internal" "tag" "x")))))))))
+                                "cmd/godriver-benchmark"))))))))
     (native-inputs
      (list go-github-com-aws-aws-lambda-go))
     (propagated-inputs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]