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 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()) } }) } ix/diff/gnu/installer/tests.scm?id=a6f2b98a1d1faa19de9564a35b1baf385c5cb056'>diff
path: root/gnu/installer/tests.scm
AgeCommit message (Expand)Author
2022-09-24installer: tests: Fix typo....* gnu/installer/tests.scm (edit-configuration-file): Fix it. Mathieu Othacehe
2022-09-24installer: Fix configuration edition during testing....When the configuration is edited, it looks like there are some leftover fragments from the input configuration: Example content of config.scm after edition: #:imported-modules '((gnu services herd) (guix build utils) (guix combinators))) unted". The unique ;; file system identifiers there ("UUIDs") can be obtained ;; by running 'blkid' in a terminal. ... This is strange because call-with-output-file uses the O_TRUNC flag which resets the file size to zero. Remove the configuration file before writing it as a work-around. * gnu/installer/tests.scm (edit-configuration-file): Remove the configuration file before re-writing it. Mathieu Othacehe
2021-12-28installer: Recommend 'ntp-service-type' for non-graphical systems....We had several bug reports with a root cause of "the clock was incorrect" from users who used the installer to install a non-graphical Guix System. * gnu/installer/services.scm (%system-services): Add the ntp-service-type. * gnu/installer/newt/services.scm (run-system-administration-cbt-page): New variable. (run-services-page): Use run-system-administration-cbt-page when not installing a desktop. * gnu/installer/tests.scm (choose-services): Add and use a choose-misc-service? procedure. * gnu/tests/install.scm (installation-target-os-for-gui-tests)<services>: Add ntp-service-type. Leo Famulari
2021-12-28installer: Offer the CUPS printing service on a dedicated page....Currently, the installer page RUN-OTHER-SERVICES-CBT-PAGE offers to the user all installer services that are not of the types 'desktop', 'network-management', or 'networking'. Concretely, this means that it offers the CUPS printing service, because that is the only service of a different type defined in the installer. In later commits, we will add some services of a new type, and we only want them to be offered when the user is installing a non-graphical system. At least one of these new services (NTP) is part of %DESKTOP-SERVICES. If it was also offered on RUN-OTHER-SERVICES-CBT-PAGE, and the user had configured a system using %DESKTOP-SERVICES, the user could accidentally add NTP to their services twice, which is an error and would break installation. So, this commit makes the RUN-OTHER-SERVICES-CBT-PAGE be more specific about what services to offer. This makes it easier to discriminate between desktop and non-desktop installations, in terms of when a given service is offered. * gnu/installer/newt/services.scm (RUN-OTHER-SERVICES-CBT-PAGE): Rename to ... (RUN-PRINTING-SERVICES-CBT-PAGE): ... new variable, and select only 'document' services. (RUN-SERVICES-PAGE): Adjust accordingly. * gnu/installer/tests.scm (CHOOSE-SERVICES): Adjust accordingly. Leo Famulari
2021-07-04installer: tests: Expect but do not select other services by default....* gnu/installer/tests.scm (choose-services): Accept a new choose-other-service? keyword argument, defaulting to false. Expect an "Other services" checkbox-list. Update docstring. Tobias Geerinckx-Rice