Skip to content

Commit

Permalink
e2e test for --all-resources
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Apr 9, 2024
1 parent 865a64a commit b4280fb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/e2e/fixtures/resources/compose.yaml
@@ -0,0 +1,5 @@
volumes:
my_vol: {}

networks:
my_net: {}
13 changes: 13 additions & 0 deletions pkg/e2e/up_test.go
Expand Up @@ -22,6 +22,7 @@ package e2e
import (
"context"
"errors"
"fmt"
"os/exec"
"strings"
"syscall"
Expand Down Expand Up @@ -165,3 +166,15 @@ func TestUpWithDependencyNotRequired(t *testing.T) {
assert.Assert(t, strings.Contains(res.Combined(), "foo"), res.Combined())
assert.Assert(t, strings.Contains(res.Combined(), " optional dependency \"bar\" failed to start"), res.Combined())
}

func TestUpWithAllResources(t *testing.T) {
c := NewCLI(t)
const projectName = "compose-e2e-all-resources"
t.Cleanup(func() {
c.RunDockerComposeCmd(t, "--project-name", projectName, "down", "-v")
})

res := c.RunDockerComposeCmd(t, "-f", "./fixtures/resources/compose.yaml", "--all-resources", "--project-name", projectName, "up")
assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf(`Volume "%s_my_vol" Created`, projectName)), res.Combined())
assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf(`Network %s_my_net Created`, projectName)), res.Combined())
}

0 comments on commit b4280fb

Please sign in to comment.