compose/internal/e2e
Nicolas De Loof c1b1739f1c fix(plan): run the pre_stop hooks as an operation of the plan
The stop of the reconciliation plan runs the pre_stop hooks itself, in the
executor, since docker/compose#14477, except the stop of a recreate: the
replacement is created under a temporary name before the old container is
stopped, and a failing hook would leave it behind for the next up to trip on.
So a container that `up` replaces still goes without its hooks.

The hooks are now an operation of the plan, RunPreStop, that the stop depends
on. Every stop the plan makes has it: a recreated container, a scale down, the
containers of a recreated network or volume, the dependents restarted with a
recreated dependency, a service that moves to a provider. A container that has
no process to run them in skips them and is stopped all the same, as for
restart and down; a hook that fails fails the plan and leaves the container
running. A container stopped for two reasons is stopped once, and its hooks
run once.

A recreation runs the hooks before it creates the replacement: one that fails
then leaves nothing behind, and no stop has to skip them any more.

The plans of services without pre_stop hooks are unchanged.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-11-27 14:08:01 +01:00
..
fixtures refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
testdata fix(plan): run the pre_stop hooks as an operation of the plan 2026-11-27 14:08:01 +01:00
api_socket_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
assert.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
bridge_convert_output_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
bridge_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
build_test.go e2e: create buildx builders on a context when TLS comes from the environment 2026-11-18 15:30:25 +01:00
cancel_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
cascade_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
checks.go fix(plan): run the pre_stop hooks as an operation of the plan 2026-11-27 14:08:01 +01:00
commit_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
compose_environment_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
compose_exec_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
compose_run_build_once_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
compose_run_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
compose_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
compose_up_test.go feat(up): stream the logs while --wait waits for the services 2026-11-17 09:35:33 +01:00
config_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
configs_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
container_name_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
cp_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
dry_run_hooks_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
e2e_config_plugin.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
e2e_config_standalone.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
env_file_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
events_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
exec_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
export_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
expose_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
framework.go e2e: create buildx builders on a context when TLS comes from the environment 2026-11-18 15:30:25 +01:00
healthcheck_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
hooks_plan_stop_test.go fix(plan): run the pre_stop hooks as an operation of the plan 2026-11-27 14:08:01 +01:00
hooks_test.go fix(plan): run the pre_stop hooks as an operation of the plan 2026-11-27 14:08:01 +01:00
image_identity_corner_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
image_identity_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
images_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
ipc_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
jobs_test.go cli: one project-resolution story — single name precedence, no swallowed load error, strict service validation 2026-11-25 16:27:43 +01:00
logs_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
main_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
model_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
multiplatform_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
networks_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
noDeps_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
orphans_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
pause_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
profiles_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
providers_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
ps_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
publish_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
pull_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
recreate_no_deps_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
remote_git_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
remote_oci_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
restart_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
scale_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
scenario.go jobs: register scheduled jobs on create and up, remove them on down 2026-11-17 13:48:57 +01:00
SCENARIO.md refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
secrets_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
start_stop_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
testdata_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
umask_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
unsupported_attributes_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
up_interactive_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
up_stale_network_test.go fix(up): recreate a stopped container whose network was removed 2026-11-17 09:14:22 +01:00
up_start_failure_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
up_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
volumes_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
wait_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00
watch_test.go refactor(e2e): move the e2e framework and tests out of pkg/ 2026-11-16 15:21:04 +01:00