diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 21caf37c..5c5a7106 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,7 @@ updates: - "/anonymizer_module" - "/collector_module" - "/corrector_module" - #- "/opendata_collector_module" + - "/opendata_collector_module" - "/opendata_module" - "/reports_module" schedule: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 547edbb0..c1c03d1b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -81,26 +81,26 @@ jobs: run: pip install tox - name: Run tox tests run: tox - # Test-Opendata-Collector: - # name: OpenData Collector Tests - # runs-on: ubuntu-22.04 - # defaults: - # run: - # working-directory: ./opendata_collector_module - # steps: - # - uses: actions/checkout@v4 - # - name: Set up Python 3.8 - # uses: actions/setup-python@v5 - # with: - # python-version: '3.8' - # cache: 'pip' - # cache-dependency-path: ./opendata_collector_module/setup.py - # - name: Install dependencies - # run: pip install -r test_requirements.txt - # - name: Install tox - # run: pip install tox - # - name: Run tox tests - # run: tox + Test-Opendata-Collector: + name: OpenData Collector Tests + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: ./opendata_collector_module + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: '3.8' + cache: 'pip' + cache-dependency-path: ./opendata_collector_module/setup.py + - name: Install dependencies + run: pip install -r test_requirements.txt + - name: Install tox + run: pip install tox + - name: Run tox tests + run: tox Test-Reports: name: Reports Tests runs-on: ubuntu-22.04 diff --git a/opendata_collector_module/etc/opendata_sources_settings.yaml b/opendata_collector_module/etc/opendata_sources_settings.yaml index 0e101562..4f0a46d8 100644 --- a/opendata_collector_module/etc/opendata_sources_settings.yaml +++ b/opendata_collector_module/etc/opendata_sources_settings.yaml @@ -16,7 +16,7 @@ # url: https://example1:/api/harvest # limit: 2000 # from_dt: '2022-12-05T00:00:00' - # until_dt: '2023-05-01T00:00:00 + # until_dt: '2023-05-01T00:00:00' # opendata_api_tz_offset: '+0200' # verify_ssl: False # diff --git a/opendata_collector_module/metrics_opendata_collector/mongodb_manager.py b/opendata_collector_module/metrics_opendata_collector/mongodb_manager.py index 53d91e0b..2149bc27 100644 --- a/opendata_collector_module/metrics_opendata_collector/mongodb_manager.py +++ b/opendata_collector_module/metrics_opendata_collector/mongodb_manager.py @@ -47,7 +47,7 @@ def __init__(self, settings: dict, instance_id: str) -> None: 'tls': bool(settings['mongodb'].get('tls')), 'tlsCAFile': settings['mongodb'].get('tls-ca-file'), } - self.client = MongoClient(self.get_mongo_uri(settings), **connect_args) + self.client: MongoClient = MongoClient(self.get_mongo_uri(settings), **connect_args) self.query_db = self.client[f'query_db_{xroad}'] self.state_db = self.client[f'opendata_collector_state_{xroad}'] diff --git a/opendata_collector_module/setup.py b/opendata_collector_module/setup.py index 90922c80..983522e6 100644 --- a/opendata_collector_module/setup.py +++ b/opendata_collector_module/setup.py @@ -25,10 +25,10 @@ from setuptools import setup requirements = [ - 'setuptools==75.1.0', - 'pymongo==4.9.1', + 'setuptools==75.3.0', + 'pymongo==4.10.1', 'requests==2.32.3', - 'tqdm==4.66.5', + 'tqdm==4.67.1', 'pyyaml==6.0.2', 'urllib3==2.2.3', ] diff --git a/opendata_collector_module/test_requirements.txt b/opendata_collector_module/test_requirements.txt index cb70b1c5..0caab98c 100644 --- a/opendata_collector_module/test_requirements.txt +++ b/opendata_collector_module/test_requirements.txt @@ -4,4 +4,4 @@ pytest-mock pytest-ruff pytest-html ruff -vcrpy==1.5.2 +vcrpy==6.0.2 diff --git a/opendata_collector_module/tox.ini b/opendata_collector_module/tox.ini index 78312216..a0f3e252 100644 --- a/opendata_collector_module/tox.ini +++ b/opendata_collector_module/tox.ini @@ -7,7 +7,7 @@ deps = -r test_requirements.txt install_command=pip install --only-binary=numpy {opts} numpy {packages} commands = coverage run --source metrics_opendata_collector -m pytest metrics_opendata_collector/ - coverage report --include=metrics_opendata_collector/* + coverage report --include=metrics_opendata_collector/* --fail-under=60 coverage html -d ../htmlcov/opendata_collector_module --include=metrics_opendata_collector/* [testenv:lint] diff --git a/run_tests.sh b/run_tests.sh deleted file mode 100755 index a17f4557..00000000 --- a/run_tests.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# pip install pytest -# pip install ruff - -export REPORTS_RUN_ENV="REPORTS_TEST" - -#set -e - -# Run Pep8 Tests -#ruff check analysis_module -#ruff check analysis_ui_module -ruff check anonymizer_module -ruff check collector_module -ruff check corrector_module -ruff check opendata_collector_module -ruff check opendata_module -ruff check reports_module - -## Run Tests -#pytest --cache-clear --ruff analysis_module --html=analysis_module/test_results.html --self-contained-html -#pytest --cache-clear --ruff analysis_ui_module --html=analysis_ui_module/test_results.html --self-contained-html -pytest --cache-clear --ruff anonymizer_module --html=anonymizer_module/test_results.html --self-contained-html -pytest --cache-clear --ruff collector_module --html=collector_module/test_results.html --self-contained-html -pytest --cache-clear --ruff corrector_module --html=corrector_module/test_results.html --self-contained-html -#pytest --cache-clear --ruff opendata_collector_module --html=opendata_collector_module/test_results.html --self-contained-html -pytest --cache-clear --ruff opendata_module --html=opendata_module/test_results.html --self-contained-html -pytest --cache-clear --ruff reports_module --html=reports_module/test_results.html --self-contained-html - -# Run CI Tests -if [[ $1 == 'CI' ]] ; then - echo "Test integration" - python3 -m pytest integration_tests -fi