Commit Graph

18 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 446e00520c format code with gofumpt
Format the code  with gofumpt to prevent my IDE from reformatting
every time I open a file. gofumpt provides a superset of gofmt,
so should not impact users that are not using gofumpt.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-17 16:50:14 +01:00
Matthieu MOREL 11e9621da5 ci: enable testifylint linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-11-12 11:12:32 +01:00
Joana Hrotko eececb9add Add profile e2e test case to document in compose
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-10-30 16:00:41 +01:00
Joana Hrotko da434013e3 Remove COMPOSE_MENU env from e2e tests
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
2024-07-01 16:31:12 +01:00
Nicolas De Loof b4280fb561 e2e test for --all-resources
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-04-09 15:30:42 +02:00
Matthieu MOREL 4f694919ff deps: remove deprecated github.com/pkg/errors
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-09-29 06:28:58 +02:00
Milas Bowman 407a0d5b53
up: fix various race/deadlock conditions on exit (#10934)
If running `up` in foreground mode (i.e. not `-d`),
when exiting via `Ctrl-C`, Compose stops all the
services it launched directly as part of that `up`
command.

In one of the E2E tests (`TestUpDependenciesNotStopped`),
this was occasionally flaking because the stop
behavior was racy: the return might not block on
the stop operation because it gets added to the
error group in a goroutine. As a result, it was
possible for no services to get terminated on exit.

There were a few other related pieces here that
I uncovered and tried to fix while stressing this.
For example, the printer could cause a deadlock if
an event was sent to it after it stopped.

Also, an error group wasn't really appropriate here;
each goroutine is a different operation for printing,
signal-handling, etc. If one part fails, we don't
actually want printing to stop, for example. This has
been switched to a `multierror.Group`, which has the
same API but coalesces errors instead of canceling a
context the moment the first one fails and returning
that single error.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-08-31 10:47:14 -04:00
Guillaume Lours 2d16a05afa
only check if a dependency is required when something unexpected happens
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-07-18 23:45:31 +02:00
Guillaume Lours bb94ea034e add support of depends_on.required attribute
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-07-18 23:13:47 +02:00
Nicolas De Loof 6f6e1635fd compute service hash with a default DeployConfig
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-05-26 14:15:33 +02:00
Nicolas De Loof 52478f0c6e wait on service containers as dependencies to be deterministic
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-02-07 16:36:45 +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
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 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
Milas Bowman 765c071c89
up: do not stop dependency containers (#9701)
This keeps parity with v1, where only the containers explicitly
passed to `up` are torn down when `Ctrl-C` is hit, so any
dependencies that got launched (or orphan containers hanging
around) should not be touched.

Fixes #9696.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-02 15:25:59 -04:00
Milas Bowman 4aa8c4a1e5 e2e: add more start/stop test cases
* Starting a service that's already running
* Stopping a service that's already stopped
* Starting/stopping multiple services (by name) at once

Also renamed a test that was about `up` behavior but was
misleadingly labeled start/stop.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-30 09:52:14 -04:00