...

Source file src/github.com/docker/cli/e2e/stack/deploy_test.go

Documentation: github.com/docker/cli/e2e/stack

     1  package stack
     2  
     3  import (
     4  	"sort"
     5  	"strings"
     6  	"testing"
     7  
     8  	"gotest.tools/v3/assert"
     9  	"gotest.tools/v3/golden"
    10  	"gotest.tools/v3/icmd"
    11  )
    12  
    13  func TestDeployWithNamedResources(t *testing.T) {
    14  	stackname := "test-stack-deploy-with-names"
    15  	composefile := golden.Path("stack-with-named-resources.yml")
    16  
    17  	result := icmd.RunCommand("docker", "stack", "deploy",
    18  		"-c", composefile, stackname)
    19  	defer icmd.RunCommand("docker", "stack", "rm", stackname)
    20  
    21  	result.Assert(t, icmd.Success)
    22  	stdout := strings.Split(result.Stdout(), "\n")
    23  	expected := strings.Split(string(golden.Get(t, "stack-deploy-with-names.golden")), "\n")
    24  	sort.Strings(stdout)
    25  	sort.Strings(expected)
    26  	assert.DeepEqual(t, stdout, expected)
    27  }
    28  

View as plain text