Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/runtest
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ for container in $(docker ps | grep ${PROJECT} | awk '{print $NF}'); do
fi
done

docker compose ${COMPOSE_FLAGS} --project-directory ${PWD} --project-name ${PROJECT} down
docker compose ${COMPOSE_FLAGS} --project-directory ${PWD} --project-name ${PROJECT} down -v
docker volume rm -f ${PROJECT}_vol-models
docker system prune -f
rm -f ${COMPOSE_DELETE}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we follow this up with docker system prune --volumes? It will do a thorough job of cleaning up but it does extend the time taken for each test to complete.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was testing 'docker volume prune' and it didn't clean anything that '-v' didn't already. If I remember correctly it should get rid of the same volumes 'docker system prune --volumes' would, but I will check it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After testing I found out that 'docker system prune --volumes' does not help with cleaning up our volumes, but it helps cleaning up cached objects. It only increased the runtime during the first execution of the command by around 10s (due to the buildup of cache). After that it was nearly instantaneous.

If we want to make sure no cached objects remain after the test run, then I think it's a good idea to add it to the script, but since it has virtually no effect on volumes I think we can drop the '--volumes' flag.


exit $STATUS
Loading