зеркало из https://github.com/microsoft/docker.git
Move TestBuildOnBuildTrigger to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
Родитель
08a10f936b
Коммит
2629e2ec23
|
@ -1287,3 +1287,23 @@ func TestBuildFailsDockerfileEmpty(t *testing.T) {
|
|||
}
|
||||
logDone("build - fails with empty dockerfile")
|
||||
}
|
||||
|
||||
func TestBuildOnBuild(t *testing.T) {
|
||||
name := "testbuildonbuild"
|
||||
defer deleteImages(name)
|
||||
_, err := buildImage(name,
|
||||
`FROM busybox
|
||||
ONBUILD RUN touch foobar`,
|
||||
true)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_, err = buildImage(name,
|
||||
fmt.Sprintf(`FROM %s
|
||||
RUN [ -f foobar ]`, name),
|
||||
true)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
logDone("build - onbuild")
|
||||
}
|
||||
|
|
|
@ -413,22 +413,6 @@ func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u
|
|||
return image, err
|
||||
}
|
||||
|
||||
func TestBuildOnBuildTrigger(t *testing.T) {
|
||||
_, err := buildImage(testContextTemplate{`
|
||||
from {IMAGE}
|
||||
onbuild run echo here is the trigger
|
||||
onbuild run touch foobar
|
||||
`,
|
||||
nil, nil,
|
||||
},
|
||||
t, nil, true,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// FIXME: test that the 'foobar' file was created in the final build.
|
||||
}
|
||||
|
||||
func TestBuildOnBuildForbiddenChainedTrigger(t *testing.T) {
|
||||
_, err := buildImage(testContextTemplate{`
|
||||
from {IMAGE}
|
||||
|
|
Загрузка…
Ссылка в новой задаче