aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgabrielgio <gabriel.giovanini@pm.me>2021-07-18 20:32:13 +0200
committergabrielgio <gabriel.giovanini@pm.me>2021-07-18 20:35:32 +0200
commit6b61c74a4da8973cfb4ea0241a1b6ec79b1095d1 (patch)
treec8ebcabb9eaa8b85dd9a96301fffcdf752759f5e
parent1f3e0496079ec2e57842b3abb7aea1630bf47f9e (diff)
downloadreddit-nextcloud-importer-6b61c74a4da8973cfb4ea0241a1b6ec79b1095d1.tar.gz
reddit-nextcloud-importer-6b61c74a4da8973cfb4ea0241a1b6ec79b1095d1.tar.bz2
reddit-nextcloud-importer-6b61c74a4da8973cfb4ea0241a1b6ec79b1095d1.zip
ref: Move to ptest-cov
Instead of using `coverage` which is not supported in the gitlab ce I'll be using `pytest-cov` to report a proper coverage in the job panel. Reference: https://docs.gitlab.com/ee/ci/pipelines/settings.html#test-coverage-parsing https://www.cypress.io/blog/2019/10/22/show-code-coverage-on-gitlab-ci/
-rw-r--r--.gitlab-ci.yml12
-rw-r--r--dev-requirements.txt3
-rw-r--r--main.py5
3 files changed, 5 insertions, 15 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a951333..c2c8eb4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -38,18 +38,8 @@ test:
stage: test
script:
- pip install -r dev-requirements.txt
- - pytest -n 4 --junitxml=report.xml
+ - pytest -n 4 --junitxml=report.xml --cov=importer
artifacts:
reports:
junit: report.xml
-coverage:
- image: python:3-alpine
- stage: test
- script:
- - pip install -r dev-requirements.txt
- - coverage run -m pytest
- - coverage xml -o cobertura.xml
- artifacts:
- reports:
- cobertura: cobertura.xml
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 0e5b1cb..b0075d6 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -3,4 +3,5 @@ pytest==6.2.4
pytest-mock==3.6.1
pytest-xdist==2.3.0
coverage==5.5
-pytest-pythonpath==0.7.3 \ No newline at end of file
+pytest-pythonpath==0.7.3
+pytest-cov==2.12.1 \ No newline at end of file
diff --git a/main.py b/main.py
index 266bb53..575a7ef 100644
--- a/main.py
+++ b/main.py
@@ -2,13 +2,12 @@ import argparse
import os
import praw
-from time import sleep
from nextcloud import NextCloud
from praw.models.util import stream_generator
-from downloader import Downloader
-from uploader import create_folders, upload_file
+from importer.downloader import Downloader
+from importer.uploader import upload_file, create_folders
parser = argparse.ArgumentParser(description="Monitor saved")
parser.add_argument('-c', '--client-id',