зеркало из https://github.com/microsoft/docker.git
Fix ImageTree test
This commit is contained in:
Родитель
0dd92d8f1c
Коммит
08623dc216
14
commands.go
14
commands.go
|
@ -1100,16 +1100,18 @@ func (cli *DockerCli) CmdImages(args ...string) error {
|
|||
}
|
||||
|
||||
var outs []APIImages
|
||||
err = json.Unmarshal(body, &outs)
|
||||
if err != nil {
|
||||
if err := json.Unmarshal(body, &outs); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var startImageArg = cmd.Arg(0)
|
||||
var startImage APIImages
|
||||
var (
|
||||
startImageArg = cmd.Arg(0)
|
||||
startImage APIImages
|
||||
|
||||
roots []APIImages
|
||||
byParent = make(map[string][]APIImages)
|
||||
)
|
||||
|
||||
var roots []APIImages
|
||||
var byParent = make(map[string][]APIImages)
|
||||
for _, image := range outs {
|
||||
if image.ParentId == "" {
|
||||
roots = append(roots, image)
|
||||
|
|
|
@ -776,13 +776,12 @@ func TestImagesTree(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
cmdOutput := string(cmdOutputBytes)
|
||||
|
||||
regexpStrings := []string{
|
||||
fmt.Sprintf("└─%s Size: (\\d+.\\d+ MB) \\(virtual \\d+.\\d+ MB\\) Tags: %s:latest", unitTestImageIDShort, unitTestImageName),
|
||||
"(?m)^ └─[0-9a-f]+",
|
||||
"(?m)^ └─[0-9a-f]+",
|
||||
"(?m)^ └─[0-9a-f]+",
|
||||
fmt.Sprintf(" └─%s Size: \\d+ B \\(virtual \\d+.\\d+ MB\\) Tags: test:latest", utils.TruncateID(image.ID)),
|
||||
"(?m) └─[0-9a-f]+.*",
|
||||
"(?m) └─[0-9a-f]+.*",
|
||||
"(?m) └─[0-9a-f]+.*",
|
||||
fmt.Sprintf("(?m)^ └─%s Size: \\d+.\\d+ MB \\(virtual \\d+.\\d+ MB\\) Tags: test:latest", utils.TruncateID(image.ID)),
|
||||
}
|
||||
|
||||
compiledRegexps := []*regexp.Regexp{}
|
||||
|
|
Загрузка…
Ссылка в новой задаче