From 80cffd7cefe8bffdafca43d4fea3db2a1004b646 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Wed, 26 Jun 2024 01:37:04 +0200 Subject: [PATCH] Change add Gitlab tests --- .gitlab-ci.yml | 75 +++++++++++++++++++++++++++++++++++++++++++ tests/search_tests.py | 5 +++ 2 files changed, 80 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..f324106e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,75 @@ +test 3.8: + image: python:3.8 + stage: test + before_script: + - pip install responses + - pip install -r requirements.txt + - pip install coveralls + script: + - cd ./tests + - coverage run --source=.. --omit=../lib/* ./all_tests.py + when: manual + rules: + - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_BRANCH == "dev" + +test 3.9: + image: python:3.9 + stage: test + before_script: + - pip install responses + - pip install -r requirements.txt + - pip install coveralls + script: + - cd ./tests + - coverage run --source=.. --omit=../lib/* ./all_tests.py + when: manual + rules: + - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_BRANCH == "dev" + +test 3.10: + image: python:3.10 + stage: test + before_script: + - pip install responses + - pip install -r requirements.txt + - pip install coveralls + script: + - cd ./tests + - coverage run --source=.. --omit=../lib/* ./all_tests.py + when: manual + rules: + - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_BRANCH == "dev" + +test 3.11: + image: python:3.11 + stage: test + before_script: + - pip install responses + - pip install -r requirements.txt + - pip install coveralls + script: + - cd ./tests + - coverage run --source=.. --omit=../lib/* ./all_tests.py + when: manual + rules: + - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_BRANCH == "dev" + +test 3.12: + image: python:3.12 + stage: test + before_script: + - pip install responses + - pip install -r requirements.txt + - pip install coveralls + script: + - cd ./tests + - coverage run --source=.. --omit=../lib/* ./all_tests.py + when: manual + rules: + - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_COMMIT_BRANCH == "dev" + diff --git a/tests/search_tests.py b/tests/search_tests.py index 3d8d162b..1c2101c4 100644 --- a/tests/search_tests.py +++ b/tests/search_tests.py @@ -1,9 +1,14 @@ +import os +import sys import warnings warnings.filterwarnings('ignore', module=r'.*fuz.*', message='.*Sequence.*') warnings.filterwarnings('ignore', module=r'.*connectionpool.*', message='.*certificate verification.*') import unittest +sys.path.insert(1, os.path.abspath('..')) +sys.path.insert(1, os.path.abspath('../lib')) + from sickgear import properFinder import sickgear