From 1025a9233733f7f0a276dcee7e660a38891127c8 Mon Sep 17 00:00:00 2001 From: Pritimay Sarkar Date: Wed, 17 Jan 2024 15:33:40 +0530 Subject: [PATCH] add pytest --- .gitignore | 3 ++- .gitlab-ci.yml | 60 +++++++++++++++++++++++++++--------------------- requirements.txt | 3 +++ 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index 28c2b13..6bff5aa 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ cloud-functions/python/functions/__pycache__/ *.pkl *.png *.svg -*.log \ No newline at end of file +*.log +scripts/temp/* \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d0b7c87..3ebb5da 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,9 @@ # https://hub.docker.com/r/library/python/tags/ image: python:latest +stages: + - test + # Change pip's cache directory to be inside the project directory since we can # only cache local items. variables: @@ -24,33 +27,38 @@ before_script: - virtualenv venv - source venv/bin/activate -test: +unit_test: + stage: test script: - - pip install ruff tox # you can also use tox - - pip install --editable ".[test]" - - tox -e py,ruff + - pytest -run: - script: - - pip install . - # run the command here - artifacts: - paths: - - build/* +# test: +# script: +# - pip install ruff tox # you can also use tox +# - pip install --editable ".[test]" +# - tox -e py,ruff -pages: - script: - - pip install sphinx sphinx-rtd-theme - - cd doc - - make html - - mv build/html/ ../public/ - artifacts: - paths: - - public - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH +# run: +# script: +# - pip install . +# # run the command here +# artifacts: +# paths: +# - build/* -deploy: - stage: deploy - script: echo "Define your deployment script!" - environment: production +# pages: +# script: +# - pip install sphinx sphinx-rtd-theme +# - cd doc +# - make html +# - mv build/html/ ../public/ +# artifacts: +# paths: +# - public +# rules: +# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + +# deploy: +# stage: deploy +# script: echo "Define your deployment script!" +# environment: production diff --git a/requirements.txt b/requirements.txt index aec2372..ddfb185 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,6 +29,7 @@ grpcio-status==1.57.0 html5lib==1.1 httplib2==0.22.0 idna==3.4 +iniconfig==2.0.0 iso8601==2.0.0 joblib==1.3.2 kiwisolver==1.4.5 @@ -42,6 +43,7 @@ packaging==23.1 pandas==2.0.3 patsy==0.5.3 Pillow==10.0.0 +pluggy==1.3.0 proto-plus==1.22.3 protobuf==4.24.0 pyasn1==0.5.0 @@ -55,6 +57,7 @@ pypdf==3.15.4 pypng==0.20220715.0 PyQRCode==1.2.1 pyserial==3.5 +pytest==7.4.4 python-bidi==0.4.2 python-dateutil==2.8.2 pytz==2023.3