github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/core/tabulate/tabulate_dc_test.go (about)

     1  package tabulate
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/lmorg/murex/lang/types"
     7  	"github.com/lmorg/murex/test"
     8  )
     9  
    10  var (
    11  	inDC = `Builds, (re)creates, starts, and attaches to containers for a service.
    12  
    13  Unless they are already running, this command also starts any linked services.
    14  
    15  The ` + "`" + `docker-compose up` + "`" + ` command aggregates the output of each container. When
    16  the command exits, all containers are stopped. Running ` + "`" + `docker-compose up -d` + "`" + `
    17  starts the containers in the background and leaves them running.
    18  
    19  If there are existing containers for a service, and the service's configuration
    20  or image was changed after the container's creation, ` + "`" + `docker-compose up` + "`" + ` picks
    21  up the changes by stopping and recreating the containers (preserving mounted
    22  volumes). To prevent Compose from picking up changes, use the ` + "`" + `--no-recreate` + "`" + `
    23  flag.
    24  
    25  If you want to force Compose to stop and recreate all containers, use the
    26  ` + "`" + `--force-recreate` + "`" + ` flag.
    27  
    28  Usage: up [options] [--scale SERVICE=NUM...] [SERVICE...]
    29  
    30  Options:
    31      -d                         Detached mode: Run containers in the background,
    32                                 print new container names.
    33                                 Incompatible with --abort-on-container-exit.
    34      --no-color                 Produce monochrome output.
    35      --no-deps                  Don't start linked services.
    36      --force-recreate           Recreate containers even if their configuration
    37                                 and image haven't changed.
    38                                 Incompatible with --no-recreate.
    39      --no-recreate              If containers already exist, don't recreate them.
    40                                 Incompatible with --force-recreate.
    41      --no-build                 Don't build an image, even if it's missing.
    42      --no-start                 Don't start the services after creating them.
    43      --build                    Build images before starting containers.
    44      --abort-on-container-exit  Stops all containers if any container was stopped.
    45                                 Incompatible with -d.
    46      -t, --timeout TIMEOUT      Use this timeout in seconds for container shutdown
    47                                 when attached or when containers are already
    48                                 running. (default: 10)
    49      --remove-orphans           Remove containers for services not
    50                                 defined in the Compose file
    51      --exit-code-from SERVICE   Return the exit code of the selected service container.
    52                                 Implies --abort-on-container-exit.
    53      --scale SERVICE=NUM        Scale SERVICE to NUM instances. Overrides the ` + "`" + `scale` + "`" + `
    54                                 setting in the Compose file if present.
    55  `
    56  
    57  	jsonDC = `{"--abort-on-container-exit":"Stops all containers if any container was stopped. Incompatible with -d.","--build":"Build images before starting containers.","--exit-code-from SERVICE":"Return the exit code of the selected service container. Implies --abort-on-container-exit.","--force-recreate":"Recreate containers even if their configuration and image haven't changed. Incompatible with --no-recreate.","--no-build":"Don't build an image, even if it's missing.","--no-color":"Produce monochrome output.","--no-deps":"Don't start linked services.","--no-recreate":"If containers already exist, don't recreate them. Incompatible with --force-recreate.","--no-start":"Don't start the services after creating them.","--remove-orphans":"Remove containers for services not defined in the Compose file","--scale SERVICE=NUM":"Scale SERVICE to NUM instances. Overrides the ` + "`" + `scale` + "`" + ` setting in the Compose file if present.","--timeout TIMEOUT":"Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)","-d":"Detached mode: Run containers in the background, print new container names. Incompatible with --abort-on-container-exit.","-t":"Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)"}`
    58  )
    59  
    60  func TestTabulateDockerCompose(t *testing.T) {
    61  	/*test.RunMethodTest(t,
    62  		cmdTabulate, "tabulate",
    63  		inDC,
    64  		types.Generic,
    65  		[]string{},
    66  		jsonDC,
    67  		nil,
    68  	)*/
    69  
    70  	test.RunMethodTest(t,
    71  		cmdTabulate, "tabulate",
    72  		inDC,
    73  		types.Generic,
    74  		[]string{fMap, fColumnWraps, fSplitComma},
    75  		jsonDC,
    76  		nil,
    77  	)
    78  }