Skip to content

Commit b4280fb

Browse files
committed
e2e test for --all-resources
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 865a64a commit b4280fb

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
volumes:
2+
my_vol: {}
3+
4+
networks:
5+
my_net: {}

pkg/e2e/up_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package e2e
2222
import (
2323
"context"
2424
"errors"
25+
"fmt"
2526
"os/exec"
2627
"strings"
2728
"syscall"
@@ -165,3 +166,15 @@ func TestUpWithDependencyNotRequired(t *testing.T) {
165166
assert.Assert(t, strings.Contains(res.Combined(), "foo"), res.Combined())
166167
assert.Assert(t, strings.Contains(res.Combined(), " optional dependency \"bar\" failed to start"), res.Combined())
167168
}
169+
170+
func TestUpWithAllResources(t *testing.T) {
171+
c := NewCLI(t)
172+
const projectName = "compose-e2e-all-resources"
173+
t.Cleanup(func() {
174+
c.RunDockerComposeCmd(t, "--project-name", projectName, "down", "-v")
175+
})
176+
177+
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/resources/compose.yaml", "--all-resources", "--project-name", projectName, "up")
178+
assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf(`Volume "%s_my_vol" Created`, projectName)), res.Combined())
179+
assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf(`Network %s_my_net Created`, projectName)), res.Combined())
180+
}

0 commit comments

Comments
 (0)