Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test

on:
pull_request:
types: [opened, edited, ready_for_review, synchronize]
types: [opened, ready_for_review, synchronize]
push:
branches:
- main
Expand Down Expand Up @@ -52,6 +52,9 @@ jobs:
- name: Check out the code
uses: actions/checkout@v5

- name: Fetch full main branch history # We don't known the the base commit of the PR
run: git fetch origin main --unshallow

# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v6
Expand Down Expand Up @@ -79,8 +82,14 @@ jobs:
path: .pytest_cache
key: pytest_cache-${{ github.head_ref }}

- name: Run unit tests with Postgresql
run: python -m pytest --cov
# Run unit tests, run them all when push to main branch
- name: Run all unit tests
run: python tests_script.py --cov --all
if: github.event_name == 'push'

- name: Run unit tests for changed files
run: python tests_script.py --cov
if: github.event_name == 'pull_request'

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_payment.py β†’ tests/core/test_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ async def test_webhook_payment_callback(
) -> None:
# We patch the callback to be able to check if it was called
mocked_callback = mocker.patch(
"tests.test_payment.callback",
"tests.core.test_payment.callback",
)

# We patch the module_list to inject our custom test module
Expand Down Expand Up @@ -337,7 +337,7 @@ async def test_webhook_payment_callback_fail(
) -> None:
# We patch the callback to be able to check if it was called
mocked_callback = mocker.patch(
"tests.test_payment.callback",
"tests.core.test_payment.callback",
side_effect=ValueError("Test error"),
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added tests/modules/__init__.py
Empty file.
Empty file added tests/modules/cdr/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
Empty file.
Loading
Loading