integration-cli: normalize comment formatting

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-11-27 15:36:45 +01:00
parent a4a0429eec
commit 580d3677c8
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
15 changed files with 64 additions and 71 deletions

View File

@ -210,26 +210,21 @@ func (s *DockerSuite) TestBuildAPIUnnormalizedTarPaths(c *testing.T) {
Name: "Dockerfile",
Size: int64(len(dockerfile)),
})
//failed to write tar file header
assert.NilError(c, err)
assert.NilError(c, err, "failed to write tar file header")
_, err = tw.Write(dockerfile)
// failed to write Dockerfile in tar file content
assert.NilError(c, err)
assert.NilError(c, err, "failed to write Dockerfile in tar file content")
err = tw.WriteHeader(&tar.Header{
Name: "dir/./file",
Size: int64(len(fileContents)),
})
//failed to write tar file header
assert.NilError(c, err)
assert.NilError(c, err, "failed to write tar file header")
_, err = tw.Write(fileContents)
// failed to write file contents in tar file content
assert.NilError(c, err)
assert.NilError(c, err, "failed to write file contents in tar file content")
// failed to close tar archive
assert.NilError(c, tw.Close())
assert.NilError(c, tw.Close(), "failed to close tar archive")
res, body, err := request.Post("/build", request.RawContent(ioutil.NopCloser(buffer)), request.ContentType("application/x-tar"))
assert.NilError(c, err)

View File

@ -255,8 +255,7 @@ func (s *DockerRegistrySuite) TestListImagesWithDigests(c *testing.T) {
assert.Assert(c, re1.MatchString(out), "expected %q: %s", re1.String(), out)
// setup image2
digest2, err := setupImageWithTag(c, "tag2")
//error setting up image
assert.NilError(c, err)
assert.NilError(c, err, "error setting up image")
imageReference2 := fmt.Sprintf("%s@%s", repoName, digest2)
c.Logf("imageReference2 = %s", imageReference2)

View File

@ -38,7 +38,7 @@ func (s *DockerSuite) TestCommitWithoutPause(c *testing.T) {
dockerCmd(c, "inspect", cleanedImageID)
}
//test commit a paused container should not unpause it after commit
// TestCommitPausedContainer tests that a paused container is not unpaused after being committed
func (s *DockerSuite) TestCommitPausedContainer(c *testing.T) {
testRequires(c, DaemonIsLinux)
out, _ := dockerCmd(c, "run", "-i", "-d", "busybox")

View File

@ -48,7 +48,7 @@ func (s *DockerSuite) TestEventsTimestampFormats(c *testing.T) {
events = events[:len(events)-1]
nEvents := len(events)
assert.Assert(c, nEvents >= 5) //Missing expected event
assert.Assert(c, nEvents >= 5)
containerEvents := eventActionsByIDAndType(c, events, name, "container")
assert.Assert(c, is.DeepEqual(containerEvents, []string{"create", "attach", "start", "die", "destroy"}), out)
}
@ -99,7 +99,7 @@ func (s *DockerSuite) TestEventsContainerEventsAttrSort(c *testing.T) {
events := strings.Split(out, "\n")
nEvents := len(events)
assert.Assert(c, nEvents >= 3) //Missing expected event
assert.Assert(c, nEvents >= 3)
matchedEvents := 0
for _, event := range events {
matches := eventstestutils.ScanMap(event)
@ -124,7 +124,7 @@ func (s *DockerSuite) TestEventsContainerEventsSinceUnixEpoch(c *testing.T) {
events = events[:len(events)-1]
nEvents := len(events)
assert.Assert(c, nEvents >= 5) //Missing expected event
assert.Assert(c, nEvents >= 5)
containerEvents := eventActionsByIDAndType(c, events, "since-epoch-test", "container")
assert.Assert(c, is.DeepEqual(containerEvents, []string{"create", "attach", "start", "die", "destroy"}), out)
}
@ -664,7 +664,7 @@ func (s *DockerSuite) TestEventsContainerRestart(c *testing.T) {
events := strings.Split(strings.TrimSpace(out), "\n")
nEvents := len(events)
assert.Assert(c, nEvents >= 1) //Missing expected event
assert.Assert(c, nEvents >= 1)
actions := eventActionsByIDAndType(c, events, "testEvent", "container")
for _, a := range actions {

View File

@ -295,7 +295,6 @@ func (s *DockerSuite) TestInspectLogConfigNoType(c *testing.T) {
}
func (s *DockerSuite) TestInspectNoSizeFlagContainer(c *testing.T) {
// Both the container and image are named busybox. docker inspect will fetch container
// JSON SizeRw and SizeRootFs field. If there is no flag --size/-s, there are no size fields.

View File

@ -66,7 +66,7 @@ func (s *DockerSuite) TestSaveAndLoadRepoStdout(c *testing.T) {
buf := make([]byte, 1024)
n, err := pty.Read(buf)
assert.NilError(c, err) //could not read tty output
assert.NilError(c, err, "could not read tty output")
assert.Assert(c, strings.Contains(string(buf[:n]), "cowardly refusing"), "help output is not being yielded")
}