Browse code

rm-gocheck: convert check.Commentf to string - other

sed -E -i 's#\bcheck.Commentf\(([^\)]+)\)#\1#g' \
-- "integration-cli/docker_cli_build_unix_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_run_test.go"

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 6e5cf532af890fd5818ae5e1849d1492fa11ee55)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Tibor Vass authored on 2019/09/10 06:08:22
Showing 4 changed files
... ...
@@ -56,7 +56,7 @@ func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *testing.T) {
56 56
 
57 57
 	var c1 hostConfig
58 58
 	err := json.Unmarshal([]byte(cfg), &c1)
59
-	assert.Assert(c, err == nil, check.Commentf(cfg))
59
+	assert.Assert(c, err == nil, cfg)
60 60
 
61 61
 	assert.Equal(c, c1.Memory, int64(64*1024*1024), "resource constraints not set properly for Memory")
62 62
 	assert.Equal(c, c1.MemorySwap, int64(-1), "resource constraints not set properly for MemorySwap")
... ...
@@ -74,7 +74,7 @@ func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *testing.T) {
74 74
 
75 75
 	var c2 hostConfig
76 76
 	err = json.Unmarshal([]byte(cfg), &c2)
77
-	assert.Assert(c, err == nil, check.Commentf(cfg))
77
+	assert.Assert(c, err == nil, cfg)
78 78
 
79 79
 	assert.Assert(c, c2.Memory != int64(64*1024*1024), "resource leaked from build for Memory")
80 80
 	assert.Assert(c, c2.MemorySwap != int64(-1), "resource leaked from build for MemorySwap")
... ...
@@ -1104,7 +1104,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkMultipleNetworksUngracefulDaemonRe
1104 1104
 func (s *DockerNetworkSuite) TestDockerNetworkRunNetByID(c *testing.T) {
1105 1105
 	out, _ := dockerCmd(c, "network", "create", "one")
1106 1106
 	containerOut, _, err := dockerCmdWithError("run", "-d", "--net", strings.TrimSpace(out), "busybox", "top")
1107
-	assert.Assert(c, err == nil, check.Commentf(containerOut))
1107
+	assert.Assert(c, err == nil, containerOut)
1108 1108
 }
1109 1109
 
1110 1110
 func (s *DockerNetworkSuite) TestDockerNetworkHostModeUngracefulDaemonRestart(c *testing.T) {
... ...
@@ -451,7 +451,7 @@ func (s *DockerSuite) TestPluginMetricsCollector(c *testing.T) {
451 451
 
452 452
 	name := "cpuguy83/docker-metrics-plugin-test:latest"
453 453
 	r := cli.Docker(cli.Args("plugin", "install", "--grant-all-permissions", name), cli.Daemon(d))
454
-	assert.Assert(c, r.Error == nil, check.Commentf(r.Combined()))
454
+	assert.Assert(c, r.Error == nil, r.Combined())
455 455
 
456 456
 	// plugin lisens on localhost:19393 and proxies the metrics
457 457
 	resp, err := http.Get("http://localhost:19393/metrics")
... ...
@@ -3633,7 +3633,7 @@ func (s *DockerSuite) TestRunStdinBlockedAfterContainerExit(c *testing.T) {
3633 3633
 
3634 3634
 	select {
3635 3635
 	case err := <-waitChan:
3636
-		assert.Assert(c, err == nil, check.Commentf(stdout.String()))
3636
+		assert.Assert(c, err == nil, stdout.String())
3637 3637
 	case <-time.After(30 * time.Second):
3638 3638
 		c.Fatal("timeout waiting for command to exit")
3639 3639
 	}