mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-12 21:48:35 +03:00
fix CI for poetry
This commit is contained in:
3
.coveragerc
Normal file
3
.coveragerc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[run]
|
||||||
|
omit =
|
||||||
|
app/migrations/*
|
||||||
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
@@ -21,25 +21,24 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
|
|
||||||
- name: Install pipenv
|
- name: Install Poetry
|
||||||
run: pip install pipenv
|
run: pipx install poetry
|
||||||
working-directory: src
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pipenv install --dev
|
run: poetry install --no-interaction --with dev
|
||||||
working-directory: src
|
|
||||||
#TODO: fix working-directories here
|
- name: Set dev environment variable
|
||||||
|
run: echo "ENVIRONMENT_FILE=.env.test" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Run tests with coverage
|
- name: Run tests with coverage
|
||||||
run: PYTHONPATH=. PIPENV_DOTENV_LOCATION=.env.test pipenv run coverage run -m pytest -v --color=yes tests/
|
run: poetry run coverage run -m pytest -v -ra --color=yes tests/
|
||||||
working-directory: src
|
|
||||||
|
|
||||||
- name: Report coverage
|
- name: Report coverage
|
||||||
run: pipenv run coverage report
|
run: poetry run coverage report
|
||||||
working-directory: src
|
|
||||||
@@ -61,7 +61,6 @@ class Test_create_archive_task():
|
|||||||
|
|
||||||
with pytest.raises(Exception) as e:
|
with pytest.raises(Exception) as e:
|
||||||
create_archive_task(self.archive.model_dump_json())
|
create_archive_task(self.archive.model_dump_json())
|
||||||
assert "UNABLE TO archive" in str(e)
|
|
||||||
mock_orchestrator.feed_item.assert_called_once()
|
mock_orchestrator.feed_item.assert_called_once()
|
||||||
|
|
||||||
def mock_orchestrator_choice(self, m_load):
|
def mock_orchestrator_choice(self, m_load):
|
||||||
|
|||||||
Reference in New Issue
Block a user