guix-commits
[Top][All Lists]
Advanced

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

01/01: gnu: docker: Adjust tests for changes in go.


From: guix-commits
Subject: 01/01: gnu: docker: Adjust tests for changes in go.
Date: Sun, 3 Nov 2019 07:02:28 -0500 (EST)

wigust pushed a commit to branch master
in repository guix.

commit a349835edb8e7e702089f6295e043c94caec6b11
Author: Oleg Pykhalov <address@hidden>
Date:   Sun Nov 3 13:25:39 2019 +0300

    gnu: docker: Adjust tests for changes in go.
    
    * gnu/packages/patches/docker-adjust-tests-for-changes-in-go.patch: New 
file.
    * gnu/local.mk (dist_patch_DATA): Use this.
    * gnu/packages/docker.scm (docker): Use this.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/docker.scm                            |  3 +-
 .../docker-adjust-tests-for-changes-in-go.patch    | 67 ++++++++++++++++++++++
 3 files changed, 70 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 5fa97c7..8eca810 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -781,6 +781,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/docbook-xsl-nonrecursive-string-subst.patch     \
   %D%/packages/patches/doc++-include-directives.patch          \
   %D%/packages/patches/doc++-segfault-fix.patch                        \
+  %D%/packages/patches/docker-adjust-tests-for-changes-in-go.patch     \
   %D%/packages/patches/docker-engine-test-noinstall.patch      \
   %D%/packages/patches/docker-fix-tests.patch                  \
   %D%/packages/patches/docker-use-fewer-modprobes.patch                \
diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm
index 6932544..70d2062 100644
--- a/gnu/packages/docker.scm
+++ b/gnu/packages/docker.scm
@@ -317,7 +317,8 @@ built-in registry server of Docker.")
        (patches
         (search-patches "docker-engine-test-noinstall.patch"
                         "docker-fix-tests.patch"
-                        "docker-use-fewer-modprobes.patch"))))
+                        "docker-use-fewer-modprobes.patch"
+                        "docker-adjust-tests-for-changes-in-go.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:modules
diff --git a/gnu/packages/patches/docker-adjust-tests-for-changes-in-go.patch 
b/gnu/packages/patches/docker-adjust-tests-for-changes-in-go.patch
new file mode 100644
index 0000000..82d92cd
--- /dev/null
+++ b/gnu/packages/patches/docker-adjust-tests-for-changes-in-go.patch
@@ -0,0 +1,67 @@
+From 4983ef7c1693ad6dfbe4e3809b12541241d7ff56 Mon Sep 17 00:00:00 2001
+From: Sebastiaan van Stijn <address@hidden>
+Date: Wed, 14 Aug 2019 02:51:08 +0200
+Subject: [PATCH] Adjust tests for changes in Go 1.12.8 / 1.11.13
+
+```
+00:38:11 === Failed
+00:38:11 === FAIL: opts TestParseDockerDaemonHost (0.00s)
+00:38:11     hosts_test.go:87: tcp tcp:a.b.c.d address expected error "Invalid 
bind address format: tcp:a.b.c.d" return, got "parse tcp://tcp:a.b.c.d: invalid 
port \":a.b.c.d\" after host" and addr
+00:38:11     hosts_test.go:87: tcp tcp:a.b.c.d/path address expected error 
"Invalid bind address format: tcp:a.b.c.d/path" return, got "parse 
tcp://tcp:a.b.c.d/path: invalid port \":a.b.c.d\" after host" and addr
+00:38:11
+00:38:11 === FAIL: opts TestParseTCP (0.00s)
+00:38:11     hosts_test.go:129: tcp tcp:a.b.c.d address expected error Invalid 
bind address format: tcp:a.b.c.d return, got parse tcp://tcp:a.b.c.d: invalid 
port ":a.b.c.d" after host and addr
+00:38:11     hosts_test.go:129: tcp tcp:a.b.c.d/path address expected error 
Invalid bind address format: tcp:a.b.c.d/path return, got parse 
tcp://tcp:a.b.c.d/path: invalid port ":a.b.c.d" after host and addr
+```
+
+Signed-off-by: Sebastiaan van Stijn <address@hidden>
+Upstream-commit: 683766613a8c1dca8f95b19ddb7e083bb3aef266
+Component: engine
+---
+ opts/hosts_test.go | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/opts/hosts_test.go b/opts/hosts_test.go
+index 8c54ec0f4b..7a0a943adf 100644
+--- a/opts/hosts_test.go
++++ b/opts/hosts_test.go
+@@ -53,8 +53,8 @@ func TestParseHost(t *testing.T) {
+ func TestParseDockerDaemonHost(t *testing.T) {
+       invalids := map[string]string{
+ 
+-              "tcp:a.b.c.d":                   "Invalid bind address format: 
tcp:a.b.c.d",
+-              "tcp:a.b.c.d/path":              "Invalid bind address format: 
tcp:a.b.c.d/path",
++              "tcp:a.b.c.d":                   "",
++              "tcp:a.b.c.d/path":              "",
+               "udp://127.0.0.1":               "Invalid bind address format: 
udp://127.0.0.1",
+               "udp://127.0.0.1:2375":          "Invalid bind address format: 
udp://127.0.0.1:2375",
+               "tcp://unix:///run/docker.sock": "Invalid proto, expected tcp: 
unix:///run/docker.sock",
+@@ -83,7 +83,7 @@ func TestParseDockerDaemonHost(t *testing.T) {
+               "localhost:5555/path":         "tcp://localhost:5555/path",
+       }
+       for invalidAddr, expectedError := range invalids {
+-              if addr, err := parseDaemonHost(invalidAddr); err == nil || 
err.Error() != expectedError {
++              if addr, err := parseDaemonHost(invalidAddr); err == nil || 
expectedError != "" && err.Error() != expectedError {
+                       t.Errorf("tcp %v address expected error %q return, got 
%q and addr %v", invalidAddr, expectedError, err, addr)
+               }
+       }
+@@ -99,8 +99,8 @@ func TestParseTCP(t *testing.T) {
+               defaultHTTPHost = "tcp://127.0.0.1:2376"
+       )
+       invalids := map[string]string{
+-              "tcp:a.b.c.d":          "Invalid bind address format: 
tcp:a.b.c.d",
+-              "tcp:a.b.c.d/path":     "Invalid bind address format: 
tcp:a.b.c.d/path",
++              "tcp:a.b.c.d":          "",
++              "tcp:a.b.c.d/path":     "",
+               "udp://127.0.0.1":      "Invalid proto, expected tcp: 
udp://127.0.0.1",
+               "udp://127.0.0.1:2375": "Invalid proto, expected tcp: 
udp://127.0.0.1:2375",
+       }
+@@ -125,7 +125,7 @@ func TestParseTCP(t *testing.T) {
+               "localhost:5555/path":         "tcp://localhost:5555/path",
+       }
+       for invalidAddr, expectedError := range invalids {
+-              if addr, err := ParseTCPAddr(invalidAddr, defaultHTTPHost); err 
== nil || err.Error() != expectedError {
++              if addr, err := ParseTCPAddr(invalidAddr, defaultHTTPHost); err 
== nil || expectedError != "" && err.Error() != expectedError {
+                       t.Errorf("tcp %v address expected error %v return, got 
%s and addr %v", invalidAddr, expectedError, err, addr)
+               }
+       }



reply via email to

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