diff options
author | 2019-06-20 16:25:28 -0700 | |
---|---|---|
committer | 2019-06-22 13:36:38 -0700 | |
commit | c1a6440899ced2f3f787352cd1d3ea1f49e520ee (patch) | |
tree | a753feeeb0f28765576584465de2b80c2b3cd008 | |
parent | Use dev.sh script for running tests and coverage (diff) |
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.
-rwxr-xr-x | scripts/dev.sh | 11 |
1 files changed, 10 insertions, 1 deletions
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 |