integration: test remote compose with include

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
pull/1992/head
CrazyMax 1 year ago
parent 9fe1083f50
commit 446ca8c764
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

@ -25,6 +25,7 @@ var bakeTests = []func(t *testing.T, sb integration.Sandbox){
testBakeRemoteContextSubdir,
testBakeRemoteCmdContextEscapeRoot,
testBakeRemoteCmdContextEscapeRelative,
testBakeRemoteComposeInclude,
}
func testBakeLocal(t *testing.T, sb integration.Sandbox) {
@ -287,3 +288,47 @@ EOT
require.NoError(t, err, out)
require.FileExists(t, filepath.Join(dirDest, "foo"))
}
func testBakeRemoteComposeInclude(t *testing.T, sb integration.Sandbox) {
composeFile := []byte(`
include:
- compose-inc.yml
services:
foo:
build:
context: .
dockerfile_inline: |
FROM busybox
RUN echo foo
`)
composeIncFile := []byte(`
services:
inc:
build:
context: .
dockerfile_inline: |
FROM busybox
RUN echo inc
`)
dirSpec := tmpdir(
t,
fstest.CreateFile("compose.yml", composeFile, 0600),
fstest.CreateFile("compose-inc.yml", composeIncFile, 0600),
)
git, err := gitutil.New(gitutil.WithWorkingDir(dirSpec))
require.NoError(t, err)
gitutil.GitInit(git, t)
gitutil.GitAdd(git, t, "compose.yml", "compose-inc.yml")
gitutil.GitCommit(git, t, "initial commit")
addr := gitutil.GitServeHTTP(git, t)
out, err := bakeCmd(
sb,
withArgs(addr, "--set", "*.output=type=cacheonly"),
)
require.NoError(t, err, out)
}

Loading…
Cancel
Save