From 5159e418c75399c3caa750e353b68c3c396437b7 Mon Sep 17 00:00:00 2001 From: matusdrobuliak66 Date: Mon, 4 Nov 2024 16:30:46 +0100 Subject: [PATCH 1/2] introduce webserver 4 tests --- .../web/server/tests/unit/with_dbs/04/conftest.py | 15 +++++++++++++++ .../unit/with_dbs/{01 => 04}/folders/conftest.py | 0 .../with_dbs/{01 => 04}/folders/test_folders.py | 0 .../garbage_collector/test_resource_manager.py | 0 ...notifications__db_comp_tasks_listening_task.py | 0 .../unit/with_dbs/{01 => 04}/products/conftest.py | 0 .../{01 => 04}/products/test_products_db.py | 0 .../{01 => 04}/products/test_products_handlers.py | 0 .../{01 => 04}/products/test_products_rpc.py | 0 .../{01 => 04}/studies_dispatcher/conftest.py | 0 .../test_studies_dispatcher_handlers.py | 0 .../test_studies_dispatcher_projects.py | 0 .../test_studies_dispatcher_studies_access.py | 0 .../unit/with_dbs/{01 => 04}/wallets/conftest.py | 0 .../{01 => 04}/wallets/payments/conftest.py | 0 .../{01 => 04}/wallets/payments/test_payments.py | 0 .../wallets/payments/test_payments_methods.py | 0 .../wallets/payments/test_payments_rpc.py | 0 .../with_dbs/{01 => 04}/wallets/test_wallets.py | 0 .../{01 => 04}/wallets/test_wallets_groups.py | 0 .../with_dbs/{01 => 04}/workspaces/conftest.py | 0 .../{01 => 04}/workspaces/test_workspaces.py | 0 .../test_workspaces__folders_and_projects_crud.py | 0 .../test_workspaces__list_projects_full_search.py | 0 ...kspaces__moving_projects_between_workspaces.py | 0 .../workspaces/test_workspaces_groups.py | 0 26 files changed, 15 insertions(+) create mode 100644 services/web/server/tests/unit/with_dbs/04/conftest.py rename services/web/server/tests/unit/with_dbs/{01 => 04}/folders/conftest.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/folders/test_folders.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/garbage_collector/test_resource_manager.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/notifications/test_notifications__db_comp_tasks_listening_task.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/products/conftest.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/products/test_products_db.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/products/test_products_handlers.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/products/test_products_rpc.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/studies_dispatcher/conftest.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/studies_dispatcher/test_studies_dispatcher_handlers.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/studies_dispatcher/test_studies_dispatcher_projects.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/studies_dispatcher/test_studies_dispatcher_studies_access.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/wallets/conftest.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/wallets/payments/conftest.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/wallets/payments/test_payments.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/wallets/payments/test_payments_methods.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/wallets/payments/test_payments_rpc.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/wallets/test_wallets.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/wallets/test_wallets_groups.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/workspaces/conftest.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/workspaces/test_workspaces.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/workspaces/test_workspaces__folders_and_projects_crud.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/workspaces/test_workspaces__list_projects_full_search.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/workspaces/test_workspaces__moving_projects_between_workspaces.py (100%) rename services/web/server/tests/unit/with_dbs/{01 => 04}/workspaces/test_workspaces_groups.py (100%) diff --git a/services/web/server/tests/unit/with_dbs/04/conftest.py b/services/web/server/tests/unit/with_dbs/04/conftest.py new file mode 100644 index 00000000000..0d136f20637 --- /dev/null +++ b/services/web/server/tests/unit/with_dbs/04/conftest.py @@ -0,0 +1,15 @@ +# pylint: disable=redefined-outer-name +# pylint: disable=unused-argument +# pylint: disable=unused-variable + + +import pytest + + +@pytest.fixture +def app_environment( + app_environment: dict[str, str], monkeypatch: pytest.MonkeyPatch +) -> dict[str, str]: + # NOTE: overrides app_environment + monkeypatch.setenv("WEBSERVER_GARBAGE_COLLECTOR", "null") + return app_environment | {"WEBSERVER_GARBAGE_COLLECTOR": "null"} diff --git a/services/web/server/tests/unit/with_dbs/01/folders/conftest.py b/services/web/server/tests/unit/with_dbs/04/folders/conftest.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/folders/conftest.py rename to services/web/server/tests/unit/with_dbs/04/folders/conftest.py diff --git a/services/web/server/tests/unit/with_dbs/01/folders/test_folders.py b/services/web/server/tests/unit/with_dbs/04/folders/test_folders.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/folders/test_folders.py rename to services/web/server/tests/unit/with_dbs/04/folders/test_folders.py diff --git a/services/web/server/tests/unit/with_dbs/01/garbage_collector/test_resource_manager.py b/services/web/server/tests/unit/with_dbs/04/garbage_collector/test_resource_manager.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/garbage_collector/test_resource_manager.py rename to services/web/server/tests/unit/with_dbs/04/garbage_collector/test_resource_manager.py diff --git a/services/web/server/tests/unit/with_dbs/01/notifications/test_notifications__db_comp_tasks_listening_task.py b/services/web/server/tests/unit/with_dbs/04/notifications/test_notifications__db_comp_tasks_listening_task.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/notifications/test_notifications__db_comp_tasks_listening_task.py rename to services/web/server/tests/unit/with_dbs/04/notifications/test_notifications__db_comp_tasks_listening_task.py diff --git a/services/web/server/tests/unit/with_dbs/01/products/conftest.py b/services/web/server/tests/unit/with_dbs/04/products/conftest.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/products/conftest.py rename to services/web/server/tests/unit/with_dbs/04/products/conftest.py diff --git a/services/web/server/tests/unit/with_dbs/01/products/test_products_db.py b/services/web/server/tests/unit/with_dbs/04/products/test_products_db.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/products/test_products_db.py rename to services/web/server/tests/unit/with_dbs/04/products/test_products_db.py diff --git a/services/web/server/tests/unit/with_dbs/01/products/test_products_handlers.py b/services/web/server/tests/unit/with_dbs/04/products/test_products_handlers.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/products/test_products_handlers.py rename to services/web/server/tests/unit/with_dbs/04/products/test_products_handlers.py diff --git a/services/web/server/tests/unit/with_dbs/01/products/test_products_rpc.py b/services/web/server/tests/unit/with_dbs/04/products/test_products_rpc.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/products/test_products_rpc.py rename to services/web/server/tests/unit/with_dbs/04/products/test_products_rpc.py diff --git a/services/web/server/tests/unit/with_dbs/01/studies_dispatcher/conftest.py b/services/web/server/tests/unit/with_dbs/04/studies_dispatcher/conftest.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/studies_dispatcher/conftest.py rename to services/web/server/tests/unit/with_dbs/04/studies_dispatcher/conftest.py diff --git a/services/web/server/tests/unit/with_dbs/01/studies_dispatcher/test_studies_dispatcher_handlers.py b/services/web/server/tests/unit/with_dbs/04/studies_dispatcher/test_studies_dispatcher_handlers.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/studies_dispatcher/test_studies_dispatcher_handlers.py rename to services/web/server/tests/unit/with_dbs/04/studies_dispatcher/test_studies_dispatcher_handlers.py diff --git a/services/web/server/tests/unit/with_dbs/01/studies_dispatcher/test_studies_dispatcher_projects.py b/services/web/server/tests/unit/with_dbs/04/studies_dispatcher/test_studies_dispatcher_projects.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/studies_dispatcher/test_studies_dispatcher_projects.py rename to services/web/server/tests/unit/with_dbs/04/studies_dispatcher/test_studies_dispatcher_projects.py diff --git a/services/web/server/tests/unit/with_dbs/01/studies_dispatcher/test_studies_dispatcher_studies_access.py b/services/web/server/tests/unit/with_dbs/04/studies_dispatcher/test_studies_dispatcher_studies_access.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/studies_dispatcher/test_studies_dispatcher_studies_access.py rename to services/web/server/tests/unit/with_dbs/04/studies_dispatcher/test_studies_dispatcher_studies_access.py diff --git a/services/web/server/tests/unit/with_dbs/01/wallets/conftest.py b/services/web/server/tests/unit/with_dbs/04/wallets/conftest.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/wallets/conftest.py rename to services/web/server/tests/unit/with_dbs/04/wallets/conftest.py diff --git a/services/web/server/tests/unit/with_dbs/01/wallets/payments/conftest.py b/services/web/server/tests/unit/with_dbs/04/wallets/payments/conftest.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/wallets/payments/conftest.py rename to services/web/server/tests/unit/with_dbs/04/wallets/payments/conftest.py diff --git a/services/web/server/tests/unit/with_dbs/01/wallets/payments/test_payments.py b/services/web/server/tests/unit/with_dbs/04/wallets/payments/test_payments.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/wallets/payments/test_payments.py rename to services/web/server/tests/unit/with_dbs/04/wallets/payments/test_payments.py diff --git a/services/web/server/tests/unit/with_dbs/01/wallets/payments/test_payments_methods.py b/services/web/server/tests/unit/with_dbs/04/wallets/payments/test_payments_methods.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/wallets/payments/test_payments_methods.py rename to services/web/server/tests/unit/with_dbs/04/wallets/payments/test_payments_methods.py diff --git a/services/web/server/tests/unit/with_dbs/01/wallets/payments/test_payments_rpc.py b/services/web/server/tests/unit/with_dbs/04/wallets/payments/test_payments_rpc.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/wallets/payments/test_payments_rpc.py rename to services/web/server/tests/unit/with_dbs/04/wallets/payments/test_payments_rpc.py diff --git a/services/web/server/tests/unit/with_dbs/01/wallets/test_wallets.py b/services/web/server/tests/unit/with_dbs/04/wallets/test_wallets.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/wallets/test_wallets.py rename to services/web/server/tests/unit/with_dbs/04/wallets/test_wallets.py diff --git a/services/web/server/tests/unit/with_dbs/01/wallets/test_wallets_groups.py b/services/web/server/tests/unit/with_dbs/04/wallets/test_wallets_groups.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/wallets/test_wallets_groups.py rename to services/web/server/tests/unit/with_dbs/04/wallets/test_wallets_groups.py diff --git a/services/web/server/tests/unit/with_dbs/01/workspaces/conftest.py b/services/web/server/tests/unit/with_dbs/04/workspaces/conftest.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/workspaces/conftest.py rename to services/web/server/tests/unit/with_dbs/04/workspaces/conftest.py diff --git a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces.py b/services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces.py rename to services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces.py diff --git a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__folders_and_projects_crud.py b/services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces__folders_and_projects_crud.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__folders_and_projects_crud.py rename to services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces__folders_and_projects_crud.py diff --git a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__list_projects_full_search.py b/services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces__list_projects_full_search.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__list_projects_full_search.py rename to services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces__list_projects_full_search.py diff --git a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__moving_projects_between_workspaces.py b/services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces__moving_projects_between_workspaces.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces__moving_projects_between_workspaces.py rename to services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces__moving_projects_between_workspaces.py diff --git a/services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces_groups.py b/services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces_groups.py similarity index 100% rename from services/web/server/tests/unit/with_dbs/01/workspaces/test_workspaces_groups.py rename to services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces_groups.py From f44baa5f86159911440a0feac60905e94328be02 Mon Sep 17 00:00:00 2001 From: matusdrobuliak66 Date: Mon, 4 Nov 2024 16:34:59 +0100 Subject: [PATCH 2/2] introduce webserver 4 tests --- .github/workflows/ci-testing-deploy.yml | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/ci-testing-deploy.yml b/.github/workflows/ci-testing-deploy.yml index 38163963d6d..34f17a07d85 100644 --- a/.github/workflows/ci-testing-deploy.yml +++ b/.github/workflows/ci-testing-deploy.yml @@ -450,6 +450,51 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} + unit-test-webserver-04: + needs: changes + if: ${{ needs.changes.outputs.webserver == 'true' || github.event_name == 'push' }} + timeout-minutes: 25 # if this timeout gets too small, then split the tests + name: "[unit] webserver 04" + runs-on: ${{ matrix.os }} + strategy: + matrix: + python: ["3.11"] + os: [ubuntu-22.04] + fail-fast: false + steps: + - uses: actions/checkout@v4 + - name: setup docker buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + - name: setup python environment + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + - name: install uv + uses: astral-sh/setup-uv@v3 + with: + version: "0.4.x" + enable-cache: false + cache-dependency-glob: "**/web/server/requirements/ci.txt" + - name: show system version + run: ./ci/helpers/show_system_versions.bash + - name: install webserver + run: ./ci/github/unit-testing/webserver.bash install + - name: test + run: ./ci/github/unit-testing/webserver.bash test_with_db 04 + - uses: codecov/codecov-action@v4.6.0 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + flags: unittests #optional + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + unit-test-storage: needs: changes if: ${{ needs.changes.outputs.storage == 'true' || github.event_name == 'push' }} @@ -1875,6 +1920,7 @@ jobs: unit-test-webserver-01, unit-test-webserver-02, unit-test-webserver-03, + unit-test-webserver-04, ] runs-on: ubuntu-latest steps: