Commit Graph

169 Commits

Author SHA1 Message Date
Guillaume Lours fd353ffa94 add support of privileged attribut in service.build section
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-12-23 09:32:48 +01:00
Guillaume Lours adf8e75317 cleanup framework.go from uncessary debug logs
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-12-21 21:28:06 +01:00
Guillaume Lours 6c537cc0f4
Merge pull request #10113 from glours/add-buildx-plugin-e2e
add buildx plugin to e2e configuration directory
2022-12-21 21:21:01 +01:00
Nicolas De Loof 9bd9f1765c check service names based on project, not running containers
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-21 21:11:44 +01:00
Guillaume Lours 5dcadc05d9
debut output for CI
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-12-21 21:09:49 +01:00
Guillaume Lours c72f161afb
change the way finding the just built compose binary
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-12-21 19:47:39 +01:00
Guillaume Lours 86a648bd51
e2e tests display Compose version used to run the test
currently the version displayed is the one installed and not the one use for the tests

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-12-21 18:38:24 +01:00
Guillaume Lours 935968fe2c
add buildx plugin to e2e configuration directory
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-12-21 15:27:34 +01:00
Nicolas De Loof 91371fef7a remove flaky TestLocalComposeLogsFollow
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-21 08:45:41 +01:00
Nicolas De Loof 986bc44549 service hash MUST exclude replicas
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-21 08:45:41 +01:00
Nicolas De Loof dacf24374d
dump stdout to help diagnose flaky test
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-20 23:50:58 +01:00
Nicolas De Loof 22d2e83896
don't fail `logs` when driver:none is set
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-20 16:23:47 +01:00
Nicolas De Loof b8bbdcd872 detect dependency failed to start
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-19 16:26:39 +01:00
Nicolas De Loof c1ce53c972 fix regression running pull --ignore-pull-failures
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-19 11:56:03 +01:00
Nicolas De Loof e42673daed only list running containers when --all=false
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-16 21:46:55 +01:00
Nicolas De Loof 5c1484ece6 apply uid/gid when creating secret from environment
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-15 15:54:04 +01:00
Nicolas De Loof 8c39b5b7fd align `--format` flag and UX with docker cli
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-14 22:53:43 +01:00
Nicolas De Loof 0368f19030 distinguish stdout and stderr in `up` logs
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-13 14:42:42 +01:00
Nicolas De Loof 3ee2ab87bb ContainerStart must run sequentially for engine to assing distinct ports within configured range
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-12 16:08:50 +01:00
Nicolas De Loof 804d7163a7 detect required service are gone to stop watching
explicit API to stop the log printer

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-12-07 21:07:27 +01:00
Sebastiaan van Stijn 87a0a57f70 Cleanup tips from output
The scan tip has been shown for two years, and most users will know
about it by now. Presenting the message also involved checking if the
plugin was installed, and wether or not the message was shown before,
which also caused some overhead, so cleaning up the output a bit.

The corresponding DOCKER_SCAN_SUGGEST environment-variable is also
removed with this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-06 23:29:03 +01:00
Guillaume Lours 95bc6c58b7
check only running containers in after down tests of profiles e2e tests
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-12-06 23:17:14 +01:00
Milas Bowman 113fb6732d
schema: add support for tmpfs.mode in mount definition (#10031)
See compose-spec/compose-go#325 for the acutal spec change. This
propagates it to the Engine API object and adds an E2E test via
Cucumber 🥒

Fixes #9873.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-12-02 11:21:53 -05:00
Guillaume Lours 707d55c77f add file header and cleanup profiles e2e tests
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-30 13:21:16 +01:00
Guillaume Lours 5edd783032 add e2e tests to check profile activation via targeted service
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-30 13:21:16 +01:00
Guillaume Lours 6fbef29619 add e2e tests to check no profile usages
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-30 13:21:16 +01:00
Guillaume Lours 7fe43a8b4a add e2e tests using explicitly profiles
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-30 13:21:16 +01:00
Guillaume Lours 8c1e2af3e1 add e2e tests to check build dependency between services
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-11-15 14:43:53 +01:00
Laura Brehm dd13299ede
Skip flaky test in CI
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-10-20 18:30:27 +02:00
Ulysses Souza 91eae4f035 Add Codecov
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-10-17 15:32:51 +02:00
Laura Brehm 25c4bcef85
Merge pull request #9824 from laurazard/cucumber-test
🥒 Cucumber PoC 🥒
2022-09-27 23:38:44 +02:00
Laura Brehm fffe7fff57
Create new `e2e` module to separate out test dependencies, move cucumber tests
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-27 02:13:52 +02:00
Laura Brehm 0a5f4e62e4
Removed tests that were replaced by Cucumber features
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-27 02:13:52 +02:00
Laura Brehm 266ab22d53
Rename start cucumber feature
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-27 02:13:51 +02:00
Laura Brehm a7476c8eeb
Convert `cascade_stop_test.go` into a cucumber feature `stop.feature`
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-27 02:13:51 +02:00
Laura Brehm 15ebff00b1
Cucumber test setup/fixtures
(run with `go test -v -run ^TestCucumberFeatures$ github.com/docker/compose/v2/pkg/e2e/cucumber`)

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-27 02:13:47 +02:00
Bartłomiej Klimczak 0d0a02cc6b
add more information when service.platform isn't part of service.build.platforms
Signed-off-by: Bartłomiej Klimczak <bartlomiej.klimczak88@gmail.com>
2022-09-26 20:44:59 +02:00
Laura Brehm 94465d57cc
Merge pull request #9863 from docker/gha-win-mac-runners
Add `merge` GitHub Actions workflow to run tests on Windows and macOS runners
2022-09-21 16:39:27 +02:00
Laura Brehm a1984ca1de
Skip some tests in CI due to flakiness
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-20 11:33:31 -04:00
Laura Brehm 118b4f07e5
Increase E2E test timeouts to reduce flakiness
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-20 11:33:31 -04:00
Laura Brehm 8714f983ac
Temporarily disable broken E2E tests on Windows
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-20 11:33:31 -04:00
Laura Brehm 937fa2dc8f
Add GitHub Action workflow to run tests on Mac/Windows runners
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-20 11:33:28 -04:00
Guillaume Lours 0e975262da
keep the platform defined at service level during build if no build platforms provided
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2022-09-15 08:30:52 +02:00
Milas Bowman 403d691abf small cleanup + godoc
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-13 18:29:33 +01:00
Milas Bowman b49b9ffe7e Merge remote-tracking branch 'upstream/v2' into down-image-rm 2022-09-13 18:00:41 +01:00
Milas Bowman 680763f8b7 down: refactor image pruning
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-13 17:23:44 +01:00
Lucas Berg 7a8d157871
convert: do not escape $ into $$ when using the --no-interpolate option (#9703)
Signed-off-by: Lucas Berg <root.lucasberg@gmail.com>
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
Co-authored-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-09-08 16:25:23 -04:00
Laura Brehm 88df5ede42
Merge pull request #9797 from laurazard/start-only-services
Only attempt to start specified services on `compose start [services]`
2022-09-08 13:00:20 -04:00
Laura Brehm a7cc406187
Cleanup E2E tests
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-09-08 12:49:42 -04:00
Milas Bowman bc806da712 build: label built images for reliable cleanup on `down`
When running `compose down`, the `--rmi` flag can be passed,
which currently supports two values:
 * `local`: remove any _implicitly-named_ images that Compose
            built
 * `all`  : remove any named images (locally-built or fetched
            from a remote repo)

Removing images in the `local` case can be problematic, as it's
historically been done via a fair amount of inference over the
Compose model. Additionally, when using the "project-model"
(by passing `--project-name` instead of using a Compose file),
we're even more limited: if no containers for the project are
running, there's nothing to derive state from to perform the
inference on.

As a first pass, we started labeling _containers_ with the name
of the locally-built image associated with it (if any) in #9715.
Unfortunately, this still suffers from the aforementioned problems
around using actual state (i.e. the containers might no longer
exist) and meant that when operating in file mode (the default),
things did not behave as expected: the label is not available
in the project since it only exists at runtime.

Now, with these changes, Compose will label any images it builds
with project metadata. Upon cleanup during `down`, the engine
image API is queried for related images and matched up with the
services for the project. As a fallback for images built with
prior versions of Compose, the previous approach is still taken.

See also:
 * https://github.com/docker/compose/issues/9655
 * https://github.com/docker/compose/pull/9715

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-07 17:57:29 -04:00