From 3f580c7dfc73d40b4162bda14477e4426c552c21 Mon Sep 17 00:00:00 2001 From: ricsik52 Date: Thu, 14 May 2020 21:01:28 +0200 Subject: [PATCH 1/2] test and coverage --- .drone.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 1d2e965..faa4d2b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,12 +21,30 @@ steps: image: python:3 commands: - pip3 install pylint bandit mccabe - - pip3 install -r requirements.txt + - pip3 install --cache-dir='./.pipcache' -r requirements.txt - find . -name "*.py" -exec python3 -m py_compile '{}' \; - find . -name "*.py" -exec pylint '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi - find . -name "*.py" -exec python3 -m mccabe --min 3 '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi - bandit -r . + || if [ $? -eq 1 ]; then echo "you fail"; fi +- name: unit_test + image: python:3.8 + environment: + PRODUCER_REDIS: cache + commands: + - pip3 install --cache-dir='./.pipcache' -r requirements.txt + - pytest + +- name: coverage + image: python:3.8 + environment: + PRODUCER_REDIS: cache + commands: + - pip3 install --cache-dir='./.pipcache' -r requirements.txt + - pip3 install --cache-dir='./.pipcache' coverage pytest + - coverage run -m pytest + - coverage report -m + - name: build-app image: banzaicloud/drone-kaniko settings: From 3b5c36048d5ac8238003759c79df2928190c65da Mon Sep 17 00:00:00 2001 From: ricsik52 Date: Thu, 14 May 2020 21:08:09 +0200 Subject: [PATCH 2/2] instal dev requirements --- .drone.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index faa4d2b..cd87854 100644 --- a/.drone.yml +++ b/.drone.yml @@ -33,6 +33,7 @@ steps: PRODUCER_REDIS: cache commands: - pip3 install --cache-dir='./.pipcache' -r requirements.txt + - pip3 install --cache-dir='./.pipcache' -r requirements_dev.txt - pytest - name: coverage @@ -41,7 +42,7 @@ steps: PRODUCER_REDIS: cache commands: - pip3 install --cache-dir='./.pipcache' -r requirements.txt - - pip3 install --cache-dir='./.pipcache' coverage pytest + - pip3 install --cache-dir='./.pipcache' -r requirements_dev.txt - coverage run -m pytest - coverage report -m