From c1a6440899ced2f3f787352cd1d3ea1f49e520ee Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Thu, 20 Jun 2019 16:25:28 -0700 Subject: Fix ownership of coverage file When coverage runs in a container, it is ran under root so the resulting coverage file is owned by root. chown is used to change ownership to be the same as the folder it is in. --- scripts/dev.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'scripts/dev.sh') diff --git a/scripts/dev.sh b/scripts/dev.sh index 490021f..6ebae71 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -31,7 +31,7 @@ fi docker run \ -it \ - --rm \ + --name snekbox_test \ --privileged \ --network host \ -h pdsnk-dev \ @@ -43,3 +43,12 @@ docker run \ --entrypoint /bin/ash \ pythondiscord/snekbox-venv:dev \ "$@" + +# Fix ownership of coverage file +docker start snekbox_test >/dev/null +docker exec \ + -it \ + snekbox_test \ + /bin/ash \ + -c 'chown "$(stat -c "%u:%g" "/snekbox-local")" /snekbox-local/.coverage' +docker rm -f snekbox_test >/dev/null -- cgit v1.2.3