Set `pullChanged` when setting `--pull` on `compose up`

Add e2e tests

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
Laura Brehm 2022-12-29 13:20:17 +00:00 committed by Nicolas De loof
parent ffce33ec11
commit a224780795
2 changed files with 16 additions and 0 deletions

View File

@ -93,6 +93,7 @@ func upCommand(p *ProjectOptions, streams api.Streams, backend api.Service) *cob
Use: "up [OPTIONS] [SERVICE...]", Use: "up [OPTIONS] [SERVICE...]",
Short: "Create and start containers", Short: "Create and start containers",
PreRunE: AdaptCmd(func(ctx context.Context, cmd *cobra.Command, args []string) error { PreRunE: AdaptCmd(func(ctx context.Context, cmd *cobra.Command, args []string) error {
create.pullChanged = cmd.Flags().Changed("pull")
create.timeChanged = cmd.Flags().Changed("timeout") create.timeChanged = cmd.Flags().Changed("timeout")
return validateFlags(&up, &create) return validateFlags(&up, &create)
}), }),

View File

@ -0,0 +1,15 @@
Feature: Up
Background:
Given a compose file
"""
services:
simple:
image: alpine
command: top
"""
Scenario: --pull always
When I run "compose up --pull=always -d"
Then the output contains "simple Pulled"