Skip to content

Commit

Permalink
Merge pull request #6 from bomfricketick/feat/update-docker
Browse files Browse the repository at this point in the history
feat/update dockerfile
  • Loading branch information
bomfricketick authored Oct 11, 2024
2 parents cad939e + 5f19d8c commit cfe216d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -26,6 +26,8 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install --no-cache-dir pip-tools
pip-compile pyproject.toml
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM python:3.12-slim

RUN pip install --no-cache-dir pip-tools

COPY . /app
WORKDIR /app

RUN pip-compile pyproject.toml

RUN pip install --no-cache-dir -r requirements.txt

ENTRYPOINT ["python", "/app/main.py"]
ENTRYPOINT ["python", "/app/report_deployer/app.py"]
22 changes: 22 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,29 @@
from unittest.mock import patch, MagicMock
from report_deployer.auth import authenticate
from report_deployer.workspace import get_workspace_id, get_dataset_id, get_report_id, post_import
from report_deployer.app import parse_arguments


def test_parse_arguments(monkeypatch):
test_args = [
'--config', 'config.yaml',
'--files', 'changelog.csv',
'--env', 'production',
'--log-level', 'DEBUG',
'--log-file', 'app.log',
'--dry-run'
]
monkeypatch.setattr('sys.argv', ['app.py'] + test_args)
args = parse_arguments()

assert args.config == 'config.yaml'
assert args.files == 'changelog.csv'
assert args.env == 'production'
assert args.log_level == 'DEBUG'
assert args.log_file == 'app.log'
assert args.dry_run is True


def setup_mock_response(mock_get, json_data):
mock_response = MagicMock()
mock_response.json.return_value = json_data
Expand Down

0 comments on commit cfe216d

Please sign in to comment.