Skip to content

Releases: celery/pytest-celery

v1.1.3

20 Sep 18:39
68b9981
Compare
Choose a tag to compare

What's Changed

Fixed issues when using Redis as a backend.

  • Build(deps): Bump boto3 from 1.35.14 to 1.35.18 by @dependabot in #409
  • Build(deps): Bump botocore from 1.35.18 to 1.35.19 by @dependabot in #408
  • Build(deps): Bump setuptools from 74.1.2 to 75.0.0 by @dependabot in #407
  • Fixed Redis error in the smoke tests: "Possible SECURITY ATTACK detected" by @Nusnus in #413
  • Fix Redis memory overcommit warning in the CI by @Nusnus in #414
  • Build(deps): Bump setuptools from 75.0.0 to 75.1.0 by @dependabot in #411
  • Relaxed flaky tests mechanism by @Nusnus in #415
  • Bumping Dependencies (inc. pyproject.toml) by @Nusnus in #416
  • Fixed IndexError when accessing the container port info by @Nusnus in #417
  • Resolved race condition during Redis backend teardown by @Nusnus in #418
  • Prepare for release: v1.1.3 by @Nusnus in #419

Full Changelog: v1.1.2...v1.1.3

v1.1.2

14 Sep 18:03
34df9d7
Compare
Choose a tag to compare

What's Changed

Key Highlights

Fixed Redis container instabilities in #405

Other Changes

  • Build(deps): Bump botocore from 1.34.158 to 1.34.161 by @dependabot in #382
  • Build(deps): Bump boto3 from 1.34.158 to 1.34.161 by @dependabot in #383
  • Build(deps): Bump botocore from 1.34.161 to 1.34.162 by @dependabot in #384
  • Build(deps): Bump setuptools from 72.1.0 to 72.2.0 by @dependabot in #381
  • Build(deps-dev): Bump types-redis from 4.6.0.20240806 to 4.6.0.20240819 by @dependabot in #385
  • Build(deps): Bump boto3 from 1.34.161 to 1.34.162 by @dependabot in #386
  • Build(deps): Bump setuptools from 72.2.0 to 73.0.0 by @dependabot in #387
  • Build(deps): Bump setuptools from 73.0.0 to 73.0.1 by @dependabot in #388
  • Build(deps-dev): Bump mypy from 1.11.1 to 1.11.2 by @dependabot in #389
  • Build(deps): Bump setuptools from 73.0.1 to 74.0.0 by @dependabot in #390
  • Build(deps): Bump urllib3 from 1.26.19 to 1.26.20 by @dependabot in #391
  • Build(deps): Bump setuptools from 74.0.0 to 74.1.0 by @dependabot in #392
  • Build(deps-dev): Bump types-redis from 4.6.0.20240819 to 4.6.0.20240903 by @dependabot in #393
  • Build(deps): Bump setuptools from 74.1.0 to 74.1.1 by @dependabot in #394
  • Build(deps): Bump setuptools from 74.1.1 to 74.1.2 by @dependabot in #395
  • Added docker cleanup auto-fixture to improve tests stability by @Nusnus in #396
  • Changed --reruns 3 -> 5 in the CI for hybrid_setup example (to mitigate docker failures) by @Nusnus in #398
  • Added "--reruns-delay 10" in the examples CI by @Nusnus in #399
  • Bumping Dependencies (inc. pyproject.toml) by @Nusnus in #397
  • Build(deps-dev): Bump pytest from 8.3.2 to 8.3.3 by @dependabot in #402
  • blacksmith.sh: Migrate workflows to Blacksmith by @blacksmith-sh in #403
  • Build(deps): Bump botocore from 1.35.14 to 1.35.18 by @dependabot in #404
  • Fix Redis container from aborting randomly by @Nusnus in #405
  • Prepare for release: v1.1.2 by @Nusnus in #406

New Contributors

  • @blacksmith-sh made their first contribution in #403

Full Changelog: v1.1.1...v1.1.2

v1.1.1

12 Aug 08:58
8c36874
Compare
Choose a tag to compare

What's Changed

  • Added installation markers for pycurl by @Nusnus in #378
  • Changed --reruns 3 -> 5 for Integration and Smoke CI by @Nusnus in #380
  • Prepare for release: v1.1.1 by @Nusnus in #379

Full Changelog: v1.1.0...v1.1.1

v1.1.0

11 Aug 12:49
08c9d6e
Compare
Choose a tag to compare

What's Changed

Key Highlights

  • New SQS broker using Localstack (Disabled by default).
  • New sqs extra for the SQS broker.

Fixes & Changes

  • Fixed package docutils installation with Python 3.8 by @Nusnus in #372
  • Added sqs extra (only) by @Nusnus in #373
  • Use set instead of list with ALL_CELERY_BROKERS and ALL_CELERY_BACKENDS by @Nusnus in #375
  • Added new localstack (SQS) broker by @Nusnus in #374
  • Prepare for release: v1.1.0 by @Nusnus in #377

Dependencies Updates

  • Build(deps): Bump setuptools from 70.3.0 to 71.0.3 by @dependabot in #354
  • Bumping Dependencies (inc. pyproject.toml) by @Nusnus in #355
  • Build(deps-dev): Bump pytest from 8.3.1 to 8.3.2 by @dependabot in #357
  • Build(deps): Bump setuptools from 71.1.0 to 72.1.0 by @dependabot in #360
  • Build(deps-dev): Bump types-redis from 4.6.0.20240425 to 4.6.0.20240726 by @dependabot in #356
  • Build(deps): Bump tenacity from 8.5.0 to 9.0.0 by @dependabot in #361
  • Build(deps): Bump redis from 5.0.7 to 5.0.8 by @dependabot in #362
  • Build(deps-dev): Bump mypy from 1.11.0 to 1.11.1 by @dependabot in #363
  • Build(deps): Bump snok/install-poetry from 1.3.4 to 1.4.0 by @dependabot in #364
  • Build(deps-dev): Bump coverage from 7.6.0 to 7.6.1 by @dependabot in #365
  • Build(deps): Bump debugpy from 1.8.2 to 1.8.3 by @dependabot in #366
  • Build(deps-dev): Bump black from 24.4.2 to 24.8.0 by @dependabot in #367
  • Build(deps): Bump snok/install-poetry from 1.4.0 to 1.4.1 by @dependabot in #368
  • Build(deps): Bump debugpy from 1.8.3 to 1.8.5 by @dependabot in #370
  • Build(deps-dev): Bump types-redis from 4.6.0.20240726 to 4.6.0.20240806 by @dependabot in #371
  • Bumping Dependencies (inc. pyproject.toml) by @Nusnus in #376

Full Changelog: v1.0.1...v1.1.0

v1.0.1

17 Jul 20:25
e2d8b76
Compare
Choose a tag to compare

What's Changed

Fixes & Changes

  • Cleanup: pytest-celery[all]==1.0.0b4 -> pytest-celery[all]==1.0.0 by @Nusnus in #330
  • Fixed hybrid_setup example build error with legacy.Dockerfile by @Nusnus in #331
  • Fix typos by @yenshirak in #339
  • Prepare for release: v1.0.1 by @Nusnus in #351
  • Added changelog for v1.0.1 by @Nusnus in #350

Security Fixes

  • CVE-2024-39689: Certifi removes GLOBALTRUST root certificate
  • CVE-2024-3651: Internationalized Domain Names in Applications (IDNA) vulnerable to denial of service from specially crafted inputs to idna.encode
  • CVE-2024-34064: Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter
  • GHSA-753j-mpmx-qq6g: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') in tornado
  • GHSA-w235-7p84-xx57: Tornado has a CRLF injection in CurlAsyncHTTPClient headers
  • CVE-2024-37891: urllib3's Proxy-Authorization request header isn't stripped during cross-origin redirects
  • CVE-2024-5569: zipp Denial of Service vulnerability
  • CVE-2024-35195: Requests Session object does not verify requests after making first request with verify=False

Dependencies Updates

New Contributors

Full Changelog: v1.0.0...v1.0.1

v1.0.0

11 Apr 23:55
cab6df7
Compare
Choose a tag to compare

v1.0.0 Official Release

User Manual: https://pytest-celery.readthedocs.io/en/latest/
PyPI: https://pypi.org/project/pytest-celery/
Source: https://github.com/celery/pytest-celery/

Install with pip install -U "pytest-celery[all]".

Key Highlights

Simple

The plugin provides a single entry point to the test case and makes sure everything is configured according to the selected architecture and requirements.

By default, all of the supported architecture components are added to a matrix of all possible combinations.
Pytest will generate a test case for each combination, and will run it in an isolated environment.

This allows separation of concerns, and makes it simple to access different architectures in a single test case, for example:

def test_hello_world(celery_setup: CeleryTestSetup):
    assert celery_setup.ready()

This code will generate test cases for all possible combinations of the supported brokers and backends, using the latest
version of Celery. Under the context of the test, each combination will be available as a celery_setup fixture,
with access to all of the required components, and will run in an isolated environment.

Flexible

The plugin is highly configurable, and can be used to test a wide range of Celery architectures.
It can be configured to use a specific version of Celery, or to use a specific version of a broker or backend.
It can also be configured to use a custom broker or backend, or to use a custom Celery application.

For basic usage, the plugin provides default components that can be configured and extended.

For more advanced use cases, the plugin uses the pytest fixtures mechanism to allow injecting custom components into the environment and build a custom Celery architecture for your project.

For example, see the rabbitmq-management example, which demonstrates how to replace the default broker matrix with a single RabbitMQ Management broker.

Fast

The plugin is designed to run tests in parallel using isolated environments. It supports the pytest-xdist plugin to run tests in parallel and scales well with available resources to improve the overall test suite performance.

Annotated

The codebase is fully annotated with type hints and is tested with mypy to ensure type safety across the board, allowing for a better development experience.

Supports

  • Workers

    • Latest Celery version.
    • Custom worker.
  • Brokers

    • RabbitMQ.
    • Redis.
    • Custom broker.
  • Backends

    • Redis.
    • Memcached.
    • Custom backend.
  • Clusters

    • Worker clusters.
    • Broker clusters.
    • Backend clusters.

Features

Architecture Injection

By default, a set of predefined components is used to build the Celery architecture for each test.
Each built-in component can be either configured or completely replaced with a custom implementation.

Architecture Injection can be done at different layers, and can be used to replace only specific elements of the architecture pipeline, or to replace the entire pipeline altogether.

Docker Based

The plugin uses docker containers to build the Celery architecture for each test.
This means that the plugin is not limited to specific versions and can be used to test potentially any Celery setup.

It uses the pytest-docker-tools plugin to manage the docker containers which is useful for accessing the docker containers in the test case during the test run and assert on their state with high granularity.

Batteries Included

The plugin provides a set of built-in components that can be used to test ideas quickly.
You can start with the default settings and gradually modify the configurations to fine-tune the test environment. By focusing on the test case, you can quickly iterate and test ideas, without wasting time on the overhead of setting up different environments manually.

Code Generation

One of the challenges in testing production Celery applications is the need to inject testing infrastructure into the Celery worker container at runtime. The plugin provides a Code Generation mechanism that can be used to inject code into the Celery worker container at runtime according to the test case. This opens the door to a wide range of testing scenarios, and allows higher level of control over the tested Celery application.

Isolated Environments

Each test case is executed in an isolated environment. This means that each test case has its own Celery architecture, and is not affected by other test cases. Tests may run in parallel and take care of tearing down themselves when they are done, regardless of the test result.

Tests as First-Class Citizens

The plugin is designed to enhance testing capabilities by treating tests as first-class citizens. It uses advanced mechanisms to encapsulate the complexity of setting up a Celery environment, thus allowing the developer to focus on the test case itself and leave the hard lifting to the plugin.

Extensible

The plugin is designed to be extensible to fit a wide range of use cases and provides a set of built-in components that can be extended to fit more advanced use cases.

It's based on the S.O.L.I.D principles and provides APIs for developing high-quality test suites. It combines the sophistication of the pytest fixtures mechanism with OOP principles to create separation of concerns between each layer of the infrastructure and its elements, which allow a higher level of granularity and control when extending the plugin.

What's Changed

Full Changelog: v1.0.0rc4...v1.0.0

v1.0.0rc4

11 Apr 21:57
6591cfd
Compare
Choose a tag to compare
v1.0.0rc4 Pre-release
Pre-release

What's Changed

Full Changelog: v1.0.0rc3...v1.0.0rc4

v1.0.0rc3

05 Apr 16:13
24c7e99
Compare
Choose a tag to compare
v1.0.0rc3 Pre-release
Pre-release

What's Changed

Full Changelog: v1.0.0rc2...v1.0.0rc3

v1.0.0rc2

27 Mar 12:06
4a64360
Compare
Choose a tag to compare
v1.0.0rc2 Pre-release
Pre-release

What's Changed

Full Changelog: v1.0.0rc1...v1.0.0rc2

v1.0.0rc1

20 Mar 15:44
b43f739
Compare
Choose a tag to compare
v1.0.0rc1 Pre-release
Pre-release

After so long, the first release candidate for v1.0.0 !

Highlights

  • Getting Started documentation is ready!
  • User Guide documentation is ready!
  • New Examples
    • worker_pool: Using gevent and solo pools.
    • vhost: Using a single Redis instance for both broker & backend, each on different vhost.
    • hybrid_setup: Executing a canvas on Celery 5 and Celery 4 workers, collaborating to process their respective segments of the workflow. This involves utilizing distinct pools and queues, along with two brokers set up with failover configurations.

In addition, the documentation provides a new way to report a Celery bug, which will be integrated into the standard bug report template at a later stage: Standalone Celery Bug Report.

Lastly, from now on, the release dates for the plugin will be described on the Milestones page.

What's Changed

Full Changelog: v1.0.0b4...v1.0.0rc1