Explorar o código

integration-cli: remove redundant logs from cp utils

Now that we marked these utilities as helpers, it should be
possible to find which test-case failed (if any), and we
can skip logging in the "happy path".

This makes these tests less noisy, which makes it easier
to find actually important information in the output:

     --- PASS: TestDockerSuite/TestCpFromCaseC (0.96s)
         docker_cli_cp_utils_test.go:244: checking that file "/tmp/test-cp-from-case-c450122079/file2" contains "file2\n"
         docker_cli_cp_utils_test.go:192: running `docker cp  962b1f3311e742b0842e13b2ad350214cea25883999fd26e87e8c9ddf40d5eb4:/root/file1 /tmp/test-cp-from-case-c450122079/file2`
         docker_cli_cp_utils_test.go:244: checking that file "/tmp/test-cp-from-case-c450122079/file2" contains "file1\n"

Some of these tests should probably be rewritten to use subtests,
but that's something for a follow-up.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn %!s(int64=5) %!d(string=hai) anos
pai
achega
3ddb4100a0
Modificáronse 1 ficheiros con 0 adicións e 5 borrados
  1. 0 5
      integration-cli/docker_cli_cp_utils_test.go

+ 0 - 5
integration-cli/docker_cli_cp_utils_test.go

@@ -192,7 +192,6 @@ func containerCpPathTrailingSep(containerID string, pathElements ...string) stri
 
 
 func runDockerCp(c *testing.T, src, dst string) error {
 func runDockerCp(c *testing.T, src, dst string) error {
 	c.Helper()
 	c.Helper()
-	c.Logf("running `docker cp %s %s`", src, dst)
 
 
 	args := []string{"cp", src, dst}
 	args := []string{"cp", src, dst}
 	if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, args...)); err != nil {
 	if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, args...)); err != nil {
@@ -203,7 +202,6 @@ func runDockerCp(c *testing.T, src, dst string) error {
 
 
 func startContainerGetOutput(c *testing.T, containerID string) (out string, err error) {
 func startContainerGetOutput(c *testing.T, containerID string) (out string, err error) {
 	c.Helper()
 	c.Helper()
-	c.Logf("running `docker start -a %s`", containerID)
 
 
 	args := []string{"start", "-a", containerID}
 	args := []string{"start", "-a", containerID}
 
 
@@ -240,7 +238,6 @@ func isCpCannotCopyReadOnly(err error) bool {
 
 
 func fileContentEquals(c *testing.T, filename, contents string) error {
 func fileContentEquals(c *testing.T, filename, contents string) error {
 	c.Helper()
 	c.Helper()
-	c.Logf("checking that file %q contains %q\n", filename, contents)
 
 
 	fileBytes, err := ioutil.ReadFile(filename)
 	fileBytes, err := ioutil.ReadFile(filename)
 	if err != nil {
 	if err != nil {
@@ -261,7 +258,6 @@ func fileContentEquals(c *testing.T, filename, contents string) error {
 
 
 func symlinkTargetEquals(c *testing.T, symlink, expectedTarget string) error {
 func symlinkTargetEquals(c *testing.T, symlink, expectedTarget string) error {
 	c.Helper()
 	c.Helper()
-	c.Logf("checking that the symlink %q points to %q\n", symlink, expectedTarget)
 
 
 	actualTarget, err := os.Readlink(symlink)
 	actualTarget, err := os.Readlink(symlink)
 	if err != nil {
 	if err != nil {
@@ -277,7 +273,6 @@ func symlinkTargetEquals(c *testing.T, symlink, expectedTarget string) error {
 
 
 func containerStartOutputEquals(c *testing.T, containerID, contents string) error {
 func containerStartOutputEquals(c *testing.T, containerID, contents string) error {
 	c.Helper()
 	c.Helper()
-	c.Logf("checking that container %q start output contains %q\n", containerID, contents)
 
 
 	out, err := startContainerGetOutput(c, containerID)
 	out, err := startContainerGetOutput(c, containerID)
 	if err != nil {
 	if err != nil {