all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sarah Morgensen <iskarian@mgsn.dev>
To: 49221@debbugs.gnu.org
Cc: Efraim Flashner <efraim@flashner.co.il>
Subject: [bug#49221] [PATCH v2 2/2] gnu: restic: Patch tests for go-1.16.
Date: Thu,  5 Aug 2021 13:20:07 -0700	[thread overview]
Message-ID: <869af0902740eceb02bf4d7125d81658c5ff9692.1628192044.git.iskarian@mgsn.dev> (raw)
In-Reply-To: <YQvvwtvQMBGNsH2b@3900XT>

* gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/backup.scm (restic): Use it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/backup.scm                       |  5 +-
 .../restic-0.9.6-fix-tests-for-go1.15.patch   | 51 +++++++++++++++++++
 3 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5b2e64a8b8..03a93caed6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1694,6 +1694,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/rtags-separate-rct.patch			\
   %D%/packages/patches/racket-minimal-sh-via-rktio.patch	\
   %D%/packages/patches/remake-impure-dirs.patch			\
+  %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch	\
   %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch	\
   %D%/packages/patches/rnp-add-version.cmake.patch		\
   %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch		\
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 9ec4e281d8..d8d8728a14 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2021 Timothy Sample <samplet@ngyro.com>
 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -928,7 +929,9 @@ is like a time machine for your data. ")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w"))))
+                "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w"))
+              (patches
+               (search-patches "restic-0.9.6-fix-tests-for-go1.15.patch"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/restic/restic"
diff --git a/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch b/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch
new file mode 100644
index 0000000000..cc510c1cfe
--- /dev/null
+++ b/gnu/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch
@@ -0,0 +1,51 @@
+This cherry-picked patch fixes tests for Go >= 1.15. Restic v0.10 (which
+includes this patch) requires go module support from the Go build system.
+Original patch follows.
+
+---
+From 97950ab81a18de06b95384da6d8646fef87c9d97 Mon Sep 17 00:00:00 2001
+From: Alexander Neumann <alexander@bumpern.de>
+Date: Sat, 12 Sep 2020 17:36:44 +0200
+Subject: [PATCH] options: Fix test for Go >= 1.15
+
+---
+ internal/options/options_test.go | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/internal/options/options_test.go b/internal/options/options_test.go
+index de94fc90a1..8d268992a3 100644
+--- a/internal/options/options_test.go
++++ b/internal/options/options_test.go
+@@ -3,6 +3,7 @@ package options
+ import (
+ 	"fmt"
+ 	"reflect"
++	"regexp"
+ 	"testing"
+ 	"time"
+ )
+@@ -199,7 +200,7 @@ var invalidSetTests = []struct {
+ 			"timeout": "2134",
+ 		},
+ 		"ns",
+-		`time: missing unit in duration 2134`,
++		`time: missing unit in duration "?2134"?`,
+ 	},
+ }
+ 
+@@ -212,8 +213,13 @@ func TestOptionsApplyInvalid(t *testing.T) {
+ 				t.Fatalf("expected error %v not found", test.err)
+ 			}
+ 
+-			if err.Error() != test.err {
+-				t.Fatalf("expected error %q, got %q", test.err, err.Error())
++			matched, err := regexp.MatchString(test.err, err.Error())
++			if err != nil {
++				t.Fatal(err)
++			}
++
++			if !matched {
++				t.Fatalf("expected error to match %q, got %q", test.err, err.Error())
+ 			}
+ 		})
+ 	}
-- 
2.31.1





      parent reply	other threads:[~2021-08-05 20:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25  6:52 [bug#49221] [PATCH 00/13] Add go-1.16 and build with gccgo Sarah Morgensen via Guix-patches via
2021-06-25  7:20 ` [bug#49221] [PATCH 01/13] gnu: go-github-com-puerkitobio-goquery: Update to 1.7.0 Sarah Morgensen via Guix-patches via
2021-06-25  7:20 ` [bug#49221] [PATCH 02/13] gnu: go-go-uber-org-atomic: Update to 1.8.0 Sarah Morgensen via Guix-patches via
2021-06-25  7:20 ` [bug#49221] [PATCH 03/13] gnu: go-github-com-sergi-go-diff: Update to 1.2.0 Sarah Morgensen via Guix-patches via
2021-06-25  7:20 ` [bug#49221] [PATCH 04/13] gnu: go-github-com-pelletier-go-toml: Update to 1.9.3 Sarah Morgensen via Guix-patches via
2021-06-25  7:20 ` [bug#49221] [PATCH 05/13] gnu: go-github-com-masterminds-goutils: Update to 1.1.1 Sarah Morgensen via Guix-patches via
2021-06-25  7:20 ` [bug#49221] [PATCH 06/13] gnu: go-github-com-magiconair-properties: Update to 1.8.5 Sarah Morgensen via Guix-patches via
2021-06-25  7:21 ` [bug#49221] [PATCH 07/13] gnu: go-github-com-dlclark-regexp2: Update to 1.4.0 Sarah Morgensen via Guix-patches via
2021-06-25  7:21 ` [bug#49221] [PATCH 08/13] gnu: earlyoom: Patch tests for go-1.16 Sarah Morgensen via Guix-patches via
2021-06-25  7:21 ` [bug#49221] [PATCH 09/13] gnu: go-github-com-bmatcuk-doublestar: Remove test incompatible with go-1.16 Sarah Morgensen via Guix-patches via
2021-08-05 17:17   ` [bug#49221] [PATCH 00/13] Add go-1.16 and build with gccgo Maxim Cournoyer
2021-08-05 20:23     ` Sarah Morgensen
2021-06-25  7:21 ` [bug#49221] [PATCH 10/13] gnu: restic: Patch tests for go-1.16 Sarah Morgensen via Guix-patches via
2021-08-05 17:20   ` [bug#49221] [PATCH 00/13] Add go-1.16 and build with gccgo Maxim Cournoyer
2021-08-05 20:24     ` Sarah Morgensen
2021-08-06  2:59       ` bug#49221: " Maxim Cournoyer
2021-06-25  7:21 ` [bug#49221] [PATCH 11/13] gnu: go-gopkg-in-check-v1: Update to latest Sarah Morgensen via Guix-patches via
2021-06-25  7:21 ` [bug#49221] [PATCH 12/13] gnu: go-etcd-io-bbolt: Update to 1.3.6 Sarah Morgensen via Guix-patches via
2021-06-25  7:21 ` [bug#49221] [PATCH 13/13] gnu: Add go-1.16 Sarah Morgensen via Guix-patches via
2021-06-28 19:22 ` [bug#49221] [PATCH 00/13] Add go-1.16 and build with gccgo Efraim Flashner
2021-07-01  3:24   ` Sarah Morgensen via Guix-patches via
2021-07-25  2:17   ` Sarah Morgensen
2021-08-05 14:03     ` Efraim Flashner
2021-08-05 20:20       ` [bug#49221] [PATCH v2 1/2] gnu: go-github-com-bmatcuk-doublestar: Remove test incompatible with go-1.16 Sarah Morgensen
2021-08-05 20:20       ` Sarah Morgensen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=869af0902740eceb02bf4d7125d81658c5ff9692.1628192044.git.iskarian@mgsn.dev \
    --to=iskarian@mgsn.dev \
    --cc=49221@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.