diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml new file mode 100644 index 0000000..c735a6a --- /dev/null +++ b/.github/workflows/run-tests.yaml @@ -0,0 +1,47 @@ +name: CI Tests + +# Controls when the workflow will run +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + changes: + runs-on: ubuntu-latest + outputs: + backend: ${{ steps.filter.outputs.backend }} + frontend: ${{ steps.filter.outputs.frontend }} + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: filter + with: + base: ${{ github.event.inputs.base }} + filters: | + backend: + - 'leaktopus_backend/**' + frontend: + - 'leaktopus_frontend/**' + + unit-tests: + needs: [ changes ] + if: ${{ needs.changes.outputs.backend == 'true' }} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4.2.0 + with: + python-version: 3.9 + cache: 'pip' # caching pip dependencies + + - name: Install dependencies + run: pip install -r leaktopus_backend/requirements.txt + + - name: Run unit tests + run: | + pytest --ignore leaktopus_backend/leaktopus/tests leaktopus_backend/leaktopus diff --git a/leaktopus_backend/leaktopus/details/scan/potential_leak_source_providers/pastebin/filter_test.py b/leaktopus_backend/leaktopus/details/scan/potential_leak_source_providers/pastebin/filter_test.py index a5ccca3..0fa54fc 100644 --- a/leaktopus_backend/leaktopus/details/scan/potential_leak_source_providers/pastebin/filter_test.py +++ b/leaktopus_backend/leaktopus/details/scan/potential_leak_source_providers/pastebin/filter_test.py @@ -1,2 +1,5 @@ +import pytest + +@pytest.mark.skip(reason="TBC") def test_should_filter_potential_leak_sources_successfully(): assert False diff --git a/leaktopus_backend/leaktopus/domain/scan/usecases/save_potential_leak_source_page_use_case_test.py b/leaktopus_backend/leaktopus/domain/scan/usecases/save_potential_leak_source_page_use_case_test.py index 58c5ddb..36981e0 100644 --- a/leaktopus_backend/leaktopus/domain/scan/usecases/save_potential_leak_source_page_use_case_test.py +++ b/leaktopus_backend/leaktopus/domain/scan/usecases/save_potential_leak_source_page_use_case_test.py @@ -199,6 +199,7 @@ def test_should_save_potential_leak_source_page_with_multiple_iols_support( ) +@pytest.mark.skip(reason="TBC") def test_should_raise_exception_when_multiple_non_acknowledged_leaks_matched_for_save( factory_leak_service, ignore_pattern_provider_mock, @@ -206,7 +207,7 @@ def test_should_raise_exception_when_multiple_non_acknowledged_leaks_matched_for page_results, potential_leak_source_scan_status_provider_mock, ): - pass + assert False def test_should_support_multiple_search_queries( diff --git a/leaktopus_backend/leaktopus/tasks/test_send_alerts_notification_task.py b/leaktopus_backend/leaktopus/tasks/send_alerts_notification_task_test.py similarity index 100% rename from leaktopus_backend/leaktopus/tasks/test_send_alerts_notification_task.py rename to leaktopus_backend/leaktopus/tasks/send_alerts_notification_task_test.py