Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store relative paths in coverage data #136

Merged
merged 1 commit into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[run]
branch = True
branch = true
include = snekbox/*
omit =
snekbox/api/app.py
snekbox/config_pb2.py
relative_files = true

[report]
exclude_lines =
Expand Down
6 changes: 3 additions & 3 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ docker-compose up

The container has all development dependencies. The repository on the host is mounted within the container; changes made to local files will also affect the container.

Note that the compose file depends on the environment variable `PWD` being set to the current working directory. It needs it to create the aforementioned bind mount. Unix shells normally have this set already. If for some reason it is not set, it needs to be manually set. A convenient way to set it is to define it in a `.env` file which Docker Compose will automatically read.

To build a normal container that can be used in production, run

```
Expand Down Expand Up @@ -62,7 +60,9 @@ Alternatively, a report can be generated as HTML with
pipenv run coverage html
```

The HTML will output to `./htmlcov/` by default
The HTML will output to `./htmlcov/` by default.

The report cannot be generated on Windows directly due to the difference in file separators in the paths. Instead, launch a shell in the container (see below) and use `coverage report` or `coverage html` (do not invoke through Pipenv).
HassanAbouelela marked this conversation as resolved.
Show resolved Hide resolved

## Launching a Shell in the Container

Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ services:
init: true
ipc: none
tty: true
working_dir: $PWD
environment:
DEBUG: 1
PIPENV_PIPFILE: /snekbox/Pipfile
PYTHONDONTWRITEBYTECODE: 1
build:
context: .
Expand All @@ -24,7 +22,7 @@ services:
cache_from:
- ghcr.io/python-discord/snekbox:latest
volumes:
- $PWD:$PWD
- .:/snekbox
- user-base:/snekbox/user_base

volumes:
Expand Down