Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkg/e2e/compose_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,18 @@ func TestLocalComposeRun(t *testing.T) {
assert.Assert(t, strings.Contains(res.Combined(), "Pulled"), res.Combined())
})

t.Run("COMPOSE_PROGRESS quiet", func(t *testing.T) {
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/run-test/quiet-pull.yaml", "down", "--remove-orphans", "--rmi", "all")
res.Assert(t, icmd.Success)

cmd := c.NewDockerComposeCmd(t, "-f", "./fixtures/run-test/quiet-pull.yaml", "run", "backend")
res = icmd.RunCmd(cmd, func(c *icmd.Cmd) {
c.Env = append(c.Env, "COMPOSE_PROGRESS=quiet")
})
assert.Assert(t, !strings.Contains(res.Combined(), "Pull complete"), res.Combined())
assert.Assert(t, !strings.Contains(res.Combined(), "Pulled"), res.Combined())
})

t.Run("--pull", func(t *testing.T) {
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/run-test/pull.yaml", "down", "--remove-orphans", "--rmi", "all")
res.Assert(t, icmd.Success)
Expand Down
4 changes: 4 additions & 0 deletions pkg/progress/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package progress
import (
"context"
"io"
"os"
"sync"

"github.com/docker/cli/cli/streams"
Expand Down Expand Up @@ -121,6 +122,9 @@ func NewWriter(ctx context.Context, out *streams.Out, progressTitle string) (Wri
if !ok {
dryRun = false
}
if v, ok := os.LookupEnv("COMPOSE_PROGRESS"); ok && Mode == ModeAuto {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a better place to manage this is addProjectFlags in cmd/compose.go, as you can set flag default value from env value (the same way we do for --env-file)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ccfd133

Mode = v
}
if Mode == ModeQuiet {
return quiet{}, nil
}
Expand Down