Skip to content

Commit

Permalink
Copy coverage to/from Docker volume
Browse files Browse the repository at this point in the history
  • Loading branch information
mgax committed Nov 7, 2023
1 parent 5dd08ce commit 7c1d091
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ jobs:
- name: Run tests
run: |
set -x
docker run -i --name=app-test -u root --link=database --link=memcached -e DATABASE_URL="postgres://postgres:password@database/app" -e APP_SECRET_KEY=xxxx -e ENVIRONMENT=test app-test
docker exec app-test ls -a
ls -a
docker cp app-test:/app/.coverage ./
ls -a
docker run -i --name=app-test -u root --link=database --link=memcached -e DATABASE_URL="postgres://postgres:password@database/app" -e APP_SECRET_KEY=xxxx -e ENVIRONMENT=test -v $(pwd)/coverage:/coverage app-test
cp coverage/.coverage ./
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ node_modules
ietf/templates/base.html
ietf/static/dist
docker/database/*.gz
/.coverage
.coverage
1 change: 1 addition & 0 deletions docker/init-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ python /app/manage.py migrate --no-input
python /app/manage.py createcachetable
python /app/manage.py collectstatic --no-input
pytest --cov
if [ -d /coverage ]; then cp .coverage /coverage/; fi
python /app/manage.py makemigrations --check --dry-run --no-input

0 comments on commit 7c1d091

Please sign in to comment.