Skip to content

Commit

Permalink
update makefile with coverage cmd (vscode)
Browse files Browse the repository at this point in the history
Add coverage cmd to generate coverage file.
Need to be used with code coverage plugin on vscode
  • Loading branch information
juggler31 committed Dec 6, 2023
1 parent 46ad1bc commit 6e5957d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ else
docker_compose=docker-compose
endif

###########################
# colors #
###########################
PRINT_COLOR = printf
COLOR_SUCCESS = \033[1;32m
COLOR_DEBUG = \033[36m
COLOR_RESET = \033[0m

build:
docker build -t geotrek . --build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG)

Expand All @@ -30,6 +38,17 @@ flake8:
messages:
$(docker_compose) run --rm web ./manage.py makemessages -a --no-location

###########################
# coverage #
###########################
verbose_level ?= 1
.PHONY: coverage
coverage:
@$(PRINT_COLOR) "$(COLOR_SUCCESS) ### Start coverage ### $(COLOR_RESET)\n"
$(docker_compose) run -e ENV=tests web coverage run ./manage.py test $(test_name) -v $(verbose_level)
$(docker_compose) run -e ENV=tests_nds web coverage run -a ./manage.py test $(test_name) -v $(verbose_level)
$(docker_compose) run -e ENV=tests web coverage lcov

test:
$(docker_compose) run -e ENV=tests --rm web ./manage.py test

Expand Down

0 comments on commit 6e5957d

Please sign in to comment.