GNU logs - #69376, boring messages


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#69376] [PATCH go-team] build-system/go: Allow providing additional test flags.
Resent-From: Troy Figiel <troy@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sun, 25 Feb 2024 09:15:01 +0000
Resent-Message-ID: <handler.69376.B.170885249620584 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 69376
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 69376 <at> debbugs.gnu.org
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.170885249620584
          (code B ref -1); Sun, 25 Feb 2024 09:15:01 +0000
Received: (at submit) by debbugs.gnu.org; 25 Feb 2024 09:14:56 +0000
Received: from localhost ([127.0.0.1]:56927 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1reAb2-0005Lt-2P
	for submit <at> debbugs.gnu.org; Sun, 25 Feb 2024 04:14:56 -0500
Received: from lists.gnu.org ([209.51.188.17]:51270)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <troy@HIDDEN>) id 1reAaz-0005Lh-Se
 for submit <at> debbugs.gnu.org; Sun, 25 Feb 2024 04:14:55 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <troy@HIDDEN>)
 id 1reAaa-0006cN-PJ
 for guix-patches@HIDDEN; Sun, 25 Feb 2024 04:14:28 -0500
Received: from mout-p-102.mailbox.org ([80.241.56.152])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <troy@HIDDEN>)
 id 1reAaX-0001mo-Rq
 for guix-patches@HIDDEN; Sun, 25 Feb 2024 04:14:28 -0500
Received: from smtp1.mailbox.org (smtp1.mailbox.org
 [IPv6:2001:67c:2050:b231:465::1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4TjJ3L1NK5z9scT
 for <guix-patches@HIDDEN>; Sun, 25 Feb 2024 10:14:22 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=troyfigiel.com;
 s=MBO0001; t=1708852462;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type;
 bh=nHlrxH0ATmtUfjFBB6WSk9/wUsS90bY95LW5rVDlT4k=;
 b=muQp2sbdFCI3NoABadS64o2ALUR4EvW8jSgj4i40fWT04JkNNGObPnZv8k2M+i98VPK6AS
 LA5q+KXZWYHZRpzI37kHAcERQO3+lalPJnXutD78R0LBYbx/6Z0CE+RrDs+dFkBLh8WfFT
 IzbqRCNilHe7QZ7CGMRuDAEwrq+rX7rsiuomtFO1ARiXJG0MqTD+PqbSB6RJRm/4ZolsAr
 ortQsXNqiZl9rFrsfOERPXLQEa6MlWg7YBHADq5Ga3W621LbMG1IfE4toIizB+7R93JOmh
 ZxEqR6ycClGy8cO+5zBitrgLzdmv+LOBidEnSWcL4PYB0b5sovCwuXq6ib/0qw==
From: Troy Figiel <troy@HIDDEN>
Date: Sun, 25 Feb 2024 10:06:52 +0100
Message-ID: <87a5noaot3.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Rspamd-Queue-Id: 4TjJ3L1NK5z9scT
Received-SPF: pass client-ip=80.241.56.152; envelope-from=troy@HIDDEN;
 helo=mout-p-102.mailbox.org
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

By allowing the use of test flags, we can more precisely skip failing tests
(for go version >=1.20), disable the vetting stage or select a subset of tests
(e.g. if an upstream flag is provided to skip tests which require a network
connection).  At the moment, the only way around these test failures is to
remove the test file completely or patch the code ourselves.

* guix/build-system/go.scm (go-build): Add test-flags variable.
(go-cross-build): Add test-flags variable.
* guix/build/go-build-system.scm (check): Pass the additional test flags to the invoke call.
---
 guix/build-system/go.scm       | 4 ++++
 guix/build/go-build-system.scm | 8 +++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 0934fded07..eb78a289f2 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -184,6 +184,7 @@ (define* (go-build name inputs
                    (unpack-path "")
                    (build-flags ''())
                    (tests? #t)
+                   (test-flags ''())
                    (allow-go-reference? #f)
                    (system (%current-system))
                    (goarch #f)
@@ -214,6 +215,7 @@ (define builder
                     #:unpack-path #$unpack-path
                     #:build-flags #$build-flags
                     #:tests? #$tests?
+                    #:test-flags #$test-flags
                     #:allow-go-reference? #$allow-go-reference?
                     #:inputs #$(input-tuples->gexp inputs)))))
 
@@ -236,6 +238,7 @@ (define* (go-cross-build name
                          (unpack-path "")
                          (build-flags ''())
                          (tests? #f)              ; nothing can be done
+                         (test-flags ''())
                          (allow-go-reference? #f)
                          (system (%current-system))
                          (goarch (first (go-target target)))
@@ -285,6 +288,7 @@ (define %outputs
                     #:unpack-path #$unpack-path
                     #:build-flags #$build-flags
                     #:tests? #$tests?
+                    #:test-flags #$test-flags
                     #:make-dynamic-linker-cache? #f ;cross-compiling
                     #:allow-go-reference? #$allow-go-reference?
                     #:inputs %build-inputs))))
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index 7f25e05d0d..24b5ec1f05 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -271,11 +271,13 @@ (define* (build #:key import-path build-flags #:allow-other-keys)
                               "Here are the results of `go env`:\n"))
       (invoke "go" "env"))))
 
-;; Can this also install commands???
-(define* (check #:key tests? import-path #:allow-other-keys)
+;; go test builds a test binary (or multiple binaries), vets the code and then
+;; runs the test binary. Build, test and test binary flags can be provided as
+;; test-flags. See "go help test" and "go help testflag" for more details.
+(define* (check #:key tests? import-path test-flags #:allow-other-keys)
   "Run the tests for the package named by IMPORT-PATH."
   (when tests?
-    (invoke "go" "test" import-path))
+    (apply invoke "go" "test" `(,import-path ,@test-flags)))
   #t)
 
 (define* (install #:key install-source? outputs import-path unpack-path #:allow-other-keys)

base-commit: 1306beaf3f6c8ddded2a956f5863bc65aad78882
-- 
2.42.0





Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Troy Figiel <troy@HIDDEN>
Subject: bug#69376: Acknowledgement ([PATCH go-team] build-system/go:
 Allow providing additional test flags.)
Message-ID: <handler.69376.B.170885249620584.ack <at> debbugs.gnu.org>
References: <87a5noaot3.fsf@HIDDEN>
X-Gnu-PR-Message: ack 69376
X-Gnu-PR-Package: guix-patches
X-Gnu-PR-Keywords: patch
Reply-To: 69376 <at> debbugs.gnu.org
Date: Sun, 25 Feb 2024 09:15:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 guix-patches@HIDDEN

If you wish to submit further information on this problem, please
send it to 69376 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
69376: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D69376
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems



Last modified: Sun, 25 Feb 2024 09:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.