Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tests): better cleanup on docker tests (railwayapp#1127)
* feat(tests): better cleanup on docker tests The `docker_run_tests`, tests, do not properly cleanup after itself. The changes made are as follows: Remove [anonymous volumes](https://docs.docker.com/reference/cli/docker/container/rm/#volumes): - add `-v` to `docker rm` Remove generated image: - call `docker rmi` after containers all stopped and removed Remove all containers related to an image and not just the most recent one Cleanup images that complete quickly: - call `stop_and_remove_container_by_image` on all images, not just ones that hang Convert fake async function to normal function: - `get_container_ids_from_image` never awaits anything. It was not a real async function. As such, the async syntax was removed for it * feat(test): gracefully cleanup failed docker build Some docker `simple_build` (or `build_with_build_time_env_vars`) create additional resources as part of their process. This is for the dbs, they create a volume and a network. But if the build itself fails, the created resources never reach the cleanup logic. This commit defers the unwrapping of the build results, to the caller; allowing us to inject cleanup logic where needed * chore: provide correct clippy command
- Loading branch information