Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Nusnus committed Oct 10, 2023
1 parent a5dfcae commit b2643f1
Show file tree
Hide file tree
Showing 51 changed files with 85 additions and 286 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Run tox for "${{ matrix.python-version }}-unit"
timeout-minutes: 5
run: |
tox --verbose --verbose -e "${{ matrix.python-version }}-unit" -- -n auto --reruns 3 --rerun-except AssertionError
tox --verbose --verbose -e "${{ matrix.python-version }}-unit" -- -n auto --reruns 5 --rerun-except AssertionError
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
- name: Run tox for "${{ matrix.python-version }}-integration"
timeout-minutes: 15
run: |
tox --verbose --verbose -e "${{ matrix.python-version }}-integration" -- -n auto --reruns 3 --rerun-except AssertionError
tox --verbose --verbose -e "${{ matrix.python-version }}-integration" -- -n auto --reruns 5 --rerun-except AssertionError
Smoke:
needs:
Expand Down Expand Up @@ -167,4 +167,4 @@ jobs:
- name: Run tox for "${{ matrix.python-version }}-smoke"
timeout-minutes: 50
run: |
tox --verbose --verbose -e "${{ matrix.python-version }}-smoke" -- -n auto --reruns 3 --rerun-except AssertionError
tox --verbose --verbose -e "${{ matrix.python-version }}-smoke" -- -n auto --reruns 5 --rerun-except AssertionError
89 changes: 21 additions & 68 deletions src/pytest_celery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,27 @@

# flake8: noqa

from pytest_celery.defaults import *

__version__ = "1.0.0a1"


from pytest_celery.api import CeleryBackendCluster
from pytest_celery.api import CeleryBrokerCluster
from pytest_celery.api import CeleryTestBackend
from pytest_celery.api import CeleryTestBroker
from pytest_celery.api import CeleryTestCluster
from pytest_celery.api import CeleryTestContainer
from pytest_celery.api import CeleryTestNode
from pytest_celery.api import CeleryTestSetup
from pytest_celery.api import CeleryTestWorker
from pytest_celery.api import CeleryWorkerCluster
from pytest_celery.api import CeleryWorkerContainer
from pytest_celery.api import RabbitMQContainer
from pytest_celery.api import RedisContainer
from pytest_celery.components import RabbitMQTestBroker
from pytest_celery.components import RedisTestBackend
from pytest_celery.components import RedisTestBroker
from pytest_celery.components import celery_base_worker_image
from pytest_celery.components import celery_rabbitmq_broker
from pytest_celery.components import celery_redis_backend
from pytest_celery.components import celery_redis_broker
from pytest_celery.components import celery_setup_worker
from pytest_celery.components import default_rabbitmq_broker
from pytest_celery.components import default_rabbitmq_broker_celeryconfig
from pytest_celery.components import default_rabbitmq_broker_cls
from pytest_celery.components import default_rabbitmq_broker_env
from pytest_celery.components import default_rabbitmq_broker_image
from pytest_celery.components import default_rabbitmq_broker_ports
from pytest_celery.components import default_redis_backend
from pytest_celery.components import default_redis_backend_celeryconfig
from pytest_celery.components import default_redis_backend_cls
from pytest_celery.components import default_redis_backend_env
from pytest_celery.components import default_redis_backend_image
from pytest_celery.components import default_redis_backend_ports
from pytest_celery.components import default_redis_broker
from pytest_celery.components import default_redis_broker_celeryconfig
from pytest_celery.components import default_redis_broker_cls
from pytest_celery.components import default_redis_broker_env
from pytest_celery.components import default_redis_broker_image
from pytest_celery.components import default_redis_broker_ports
from pytest_celery.components import default_worker_celerky_worker_queue
from pytest_celery.components import default_worker_celery_log_level
from pytest_celery.components import default_worker_celery_version
from pytest_celery.components import default_worker_celery_worker_name
from pytest_celery.components import default_worker_cls
from pytest_celery.components import default_worker_container
from pytest_celery.components import default_worker_container_cls
from pytest_celery.components import default_worker_container_session_cls
from pytest_celery.components import default_worker_env
from pytest_celery.components import default_worker_initial_content
from pytest_celery.components import default_worker_signals
from pytest_celery.components import default_worker_tasks
from pytest_celery.components import default_worker_volume
from pytest_celery.fixtures import celery_backend
from pytest_celery.fixtures import celery_backend_cluster
from pytest_celery.fixtures import celery_backend_cluster_config
from pytest_celery.fixtures import celery_broker
from pytest_celery.fixtures import celery_broker_cluster
from pytest_celery.fixtures import celery_broker_cluster_config
from pytest_celery.fixtures import celery_setup
from pytest_celery.fixtures import celery_setup_app
from pytest_celery.fixtures import celery_setup_cls
from pytest_celery.fixtures import celery_setup_config
from pytest_celery.fixtures import celery_setup_name
from pytest_celery.fixtures import celery_worker
from pytest_celery.fixtures import celery_worker_cluster
from pytest_celery.fixtures import celery_worker_cluster_config
from pytest_celery.api.backend import *
from pytest_celery.api.base import *
from pytest_celery.api.broker import *
from pytest_celery.api.container import *
from pytest_celery.api.setup import *
from pytest_celery.api.worker import *
from pytest_celery.defaults import *
from pytest_celery.fixtures.backend import *
from pytest_celery.fixtures.broker import *
from pytest_celery.fixtures.setup import *
from pytest_celery.fixtures.worker import *
from pytest_celery.vendors.rabbitmq.api import *
from pytest_celery.vendors.rabbitmq.container import *
from pytest_celery.vendors.rabbitmq.fixtures import *
from pytest_celery.vendors.redis.backend.api import *
from pytest_celery.vendors.redis.backend.fixtures import *
from pytest_celery.vendors.redis.broker.api import *
from pytest_celery.vendors.redis.broker.fixtures import *
from pytest_celery.vendors.redis.container import *
from pytest_celery.vendors.worker.container import *
from pytest_celery.vendors.worker.fixtures import *

Check warning on line 30 in src/pytest_celery/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/__init__.py#L10-L30

Added lines #L10 - L30 were not covered by tests
15 changes: 0 additions & 15 deletions src/pytest_celery/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +0,0 @@
# flake8: noqa

from pytest_celery.api.backend import CeleryBackendCluster
from pytest_celery.api.backend import CeleryTestBackend
from pytest_celery.api.base import CeleryTestCluster
from pytest_celery.api.base import CeleryTestNode
from pytest_celery.api.broker import CeleryBrokerCluster
from pytest_celery.api.broker import CeleryTestBroker
from pytest_celery.api.container import CeleryTestContainer
from pytest_celery.api.containers.rabbitmq import RabbitMQContainer
from pytest_celery.api.containers.redis import RedisContainer
from pytest_celery.api.containers.worker import CeleryWorkerContainer
from pytest_celery.api.setup import CeleryTestSetup
from pytest_celery.api.worker import CeleryTestWorker
from pytest_celery.api.worker import CeleryWorkerCluster
5 changes: 0 additions & 5 deletions src/pytest_celery/api/containers/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/pytest_celery/api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(
self._backend_cluster = backend_cluster
self._app = app

from pytest_celery.components.worker.tasks import ping
from pytest_celery.vendors.worker.tasks import ping

self.ping = ping

Expand Down
2 changes: 1 addition & 1 deletion src/pytest_celery/api/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pytest_celery.api.base import CeleryTestCluster
from pytest_celery.api.base import CeleryTestNode

Check warning on line 9 in src/pytest_celery/api/worker.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/api/worker.py#L8-L9

Added lines #L8 - L9 were not covered by tests
from pytest_celery.api.container import CeleryTestContainer
from pytest_celery.api.containers.worker import CeleryWorkerContainer
from pytest_celery.vendors.worker.container import CeleryWorkerContainer

Check warning on line 11 in src/pytest_celery/api/worker.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/api/worker.py#L11

Added line #L11 was not covered by tests


class CeleryTestWorker(CeleryTestNode):
Expand Down
41 changes: 0 additions & 41 deletions src/pytest_celery/components/__init__.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/pytest_celery/components/backend/__init__.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/pytest_celery/components/backend/redis/__init__.py

This file was deleted.

18 changes: 0 additions & 18 deletions src/pytest_celery/components/broker/__init__.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/pytest_celery/components/broker/rabbitmq/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions src/pytest_celery/components/broker/rabbitmq/api.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/pytest_celery/components/broker/redis/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions src/pytest_celery/components/broker/redis/api.py

This file was deleted.

18 changes: 0 additions & 18 deletions src/pytest_celery/components/worker/__init__.py

This file was deleted.

17 changes: 0 additions & 17 deletions src/pytest_celery/fixtures/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +0,0 @@
# flake8: noqa


from pytest_celery.fixtures.backend import celery_backend
from pytest_celery.fixtures.backend import celery_backend_cluster
from pytest_celery.fixtures.backend import celery_backend_cluster_config
from pytest_celery.fixtures.broker import celery_broker
from pytest_celery.fixtures.broker import celery_broker_cluster
from pytest_celery.fixtures.broker import celery_broker_cluster_config
from pytest_celery.fixtures.setup import celery_setup
from pytest_celery.fixtures.setup import celery_setup_app
from pytest_celery.fixtures.setup import celery_setup_cls
from pytest_celery.fixtures.setup import celery_setup_config
from pytest_celery.fixtures.setup import celery_setup_name
from pytest_celery.fixtures.worker import celery_worker
from pytest_celery.fixtures.worker import celery_worker_cluster
from pytest_celery.fixtures.worker import celery_worker_cluster_config
Empty file.
Empty file.
5 changes: 5 additions & 0 deletions src/pytest_celery/vendors/rabbitmq/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from pytest_celery.api.broker import CeleryTestBroker

Check warning on line 1 in src/pytest_celery/vendors/rabbitmq/api.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/vendors/rabbitmq/api.py#L1

Added line #L1 was not covered by tests


class RabbitMQTestBroker(CeleryTestBroker):
pass

Check warning on line 5 in src/pytest_celery/vendors/rabbitmq/api.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/vendors/rabbitmq/api.py#L4-L5

Added lines #L4 - L5 were not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from pytest_docker_tools import fxtr

from pytest_celery import defaults
from pytest_celery.api.containers.rabbitmq import RabbitMQContainer
from pytest_celery.components.broker.rabbitmq.api import RabbitMQTestBroker
from pytest_celery.vendors.rabbitmq.api import RabbitMQTestBroker
from pytest_celery.vendors.rabbitmq.container import RabbitMQContainer

Check warning on line 11 in src/pytest_celery/vendors/rabbitmq/fixtures.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/vendors/rabbitmq/fixtures.py#L10-L11

Added lines #L10 - L11 were not covered by tests


@pytest.fixture
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import gc

from pytest_celery.fixtures.backend import CeleryTestBackend
from pytest_celery.api.backend import CeleryTestBackend

Check warning on line 3 in src/pytest_celery/vendors/redis/backend/api.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/vendors/redis/backend/api.py#L3

Added line #L3 was not covered by tests


class RedisTestBackend(CeleryTestBackend):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from pytest_docker_tools import fxtr

from pytest_celery import defaults
from pytest_celery.api.containers.redis import RedisContainer
from pytest_celery.components.backend.redis.api import RedisTestBackend
from pytest_celery.vendors.redis.backend.api import RedisTestBackend
from pytest_celery.vendors.redis.container import RedisContainer

Check warning on line 11 in src/pytest_celery/vendors/redis/backend/fixtures.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/vendors/redis/backend/fixtures.py#L10-L11

Added lines #L10 - L11 were not covered by tests


@pytest.fixture
Expand Down
Empty file.
5 changes: 5 additions & 0 deletions src/pytest_celery/vendors/redis/broker/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from pytest_celery.api.broker import CeleryTestBroker

Check warning on line 1 in src/pytest_celery/vendors/redis/broker/api.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/vendors/redis/broker/api.py#L1

Added line #L1 was not covered by tests


class RedisTestBroker(CeleryTestBroker):
pass

Check warning on line 5 in src/pytest_celery/vendors/redis/broker/api.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/vendors/redis/broker/api.py#L4-L5

Added lines #L4 - L5 were not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from pytest_docker_tools import fxtr

from pytest_celery import defaults
from pytest_celery.api.containers.redis import RedisContainer
from pytest_celery.components.broker.redis.api import RedisTestBroker
from pytest_celery.vendors.redis.broker.api import RedisTestBroker
from pytest_celery.vendors.redis.container import RedisContainer

Check warning on line 11 in src/pytest_celery/vendors/redis/broker/fixtures.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/vendors/redis/broker/fixtures.py#L10-L11

Added lines #L10 - L11 were not covered by tests


@pytest.fixture
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def env(cls, celery_worker_cluster_config: dict) -> dict:

@classmethod
def initial_content(cls, worker_tasks: set, worker_signals: Union[set, None] = None) -> dict:
from pytest_celery.components.worker import app as app_module
from pytest_celery.vendors.worker import app as app_module

app_module_src = inspect.getsource(app_module)

Expand All @@ -63,7 +63,7 @@ def initial_content(cls, worker_tasks: set, worker_signals: Union[set, None] = N

@classmethod
def _initial_content_worker_tasks(cls, worker_tasks: set) -> dict:
from pytest_celery.components.worker import tasks
from pytest_celery.vendors.worker import tasks

worker_tasks.add(tasks)

Expand Down
Loading

0 comments on commit b2643f1

Please sign in to comment.