Releases: celery/pytest-celery
v1.1.3
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
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
v1.1.0
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
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
- Build(deps-dev): Bump black from 24.3.0 to 24.4.0 by @dependabot in #289
- Build(deps): Bump setuptools from 69.2.0 to 69.5.1 by @dependabot in #290
- Build(deps-dev): Bump types-redis from 4.6.0.20240409 to 4.6.0.20240417 by @dependabot in #292
- Build(deps): Bump celery from 5.3.6 to 5.4.0 by @dependabot in #293
- Build(deps-dev): Bump types-redis from 4.6.0.20240417 to 4.6.0.20240423 by @dependabot in #295
- Build(deps-dev): Bump coverage from 7.4.4 to 7.5.0 by @dependabot in #296
- Build(deps-dev): Bump mypy from 1.9.0 to 1.10.0 by @dependabot in #298
- Build(deps-dev): Bump black from 24.4.0 to 24.4.1 by @dependabot in #299
- Build(deps-dev): Bump types-redis from 4.6.0.20240423 to 4.6.0.20240425 by @dependabot in #300
- Build(deps): Bump redis from 5.0.3 to 5.0.4 by @dependabot in #297
- Build(deps-dev): Bump black from 24.4.1 to 24.4.2 by @dependabot in #301
- Build(deps-dev): Bump pytest from 8.1.1 to 8.2.0 by @dependabot in #302
- Build(deps-dev): Bump pytest-xdist from 3.5.0 to 3.6.1 by @dependabot in #303
- Build(deps-dev): Bump coverage from 7.5.0 to 7.5.1 by @dependabot in #306
- Build(deps-dev): Bump sphinx-click from 5.1.0 to 6.0.0 by @dependabot in #308
- Build(deps-dev): Bump pytest from 8.2.0 to 8.2.1 by @dependabot in #309
- Revert "Build(deps-dev): Bump pytest from 8.2.0 to 8.2.1" by @Nusnus in #310
- Pinned requests to v2.31.0 due to docker-py bug #3256 by @Nusnus in #313
- Build(deps-dev): Bump pytest from 8.2.0 to 8.2.1 by @dependabot in #311
- Build(deps): Bump setuptools from 69.5.1 to 70.0.0 by @dependabot in #312
- Build(deps): Bump docker from 7.0.0 to 7.1.0 by @dependabot in #315
- Fixed docker-py & requests issue by @Nusnus in #316
- Build(deps-dev): Bump coverage from 7.5.1 to 7.5.2 by @dependabot in #317
- Build(deps-dev): Bump coverage from 7.5.2 to 7.5.3 by @dependabot in #319
- Build(deps-dev): Bump pytest from 8.2.1 to 8.2.2 by @dependabot in #320
- Build(deps): Bump redis from 5.0.4 to 5.0.5 by @dependabot in #321
- Build(deps): Bump redis from 5.0.5 to 5.0.6 by @dependabot in #323
- Build(deps): Bump psutil from 5.9.8 to 6.0.0 by @dependabot in #325
- Build(deps): Bump setuptools from 70.0.0 to 70.1.0 by @dependabot in #327
- Build(deps-dev): Bump coverage from 7.5.3 to 7.5.4 by @dependabot in #328
- Build(deps-dev): Bump mypy from 1.10.0 to 1.10.1 by @dependabot in #329
- Build(deps): Bump setuptools from 70.1.0 to 70.1.1 by @dependabot in #332
- Build(deps): Bump debugpy from 1.8.1 to 1.8.2 by @dependabot in #333
- Build(deps): Bump redis from 5.0.6 to 5.0.7 by @dependabot in #334
- Build(deps): Bump setuptools from 70.1.1 to 70.2.0 by @dependabot in #336
- Build(deps): Bump certifi from 2024.2.2 to 2024.7.4 by @dependabot in #337
- Build(deps-dev): Bump pytest-subtests from 0.12.1 to 0.13.0 by @dependabot in #338
- Build(deps): Bump setuptools from 70.2.0 to 70.3.0 by @dependabot in #340
- Build(deps-dev): Bump coverage from 7.5.4 to 7.6.0 by @dependabot in #341
- Changed "retry" dependency to "tenacity" by @Nusnus in #342
- Build(deps): Bump idna from 3.6 to 3.7 by @dependabot in #343
- Build(deps-dev): Bump jinja2 from 3.1.3 to 3.1.4 by @dependabot in #344
- Build(deps-dev): Bump tornado from 6.4 to 6.4.1 by @dependabot in #345
- Build(deps): Bump urllib3 from 2.2.1 to 2.2.2 by @dependabot in #346
- Build(deps-dev): Bump zipp from 3.18.0 to 3.19.1 by @dependabot in #347
- Bumping Dependencies by @Nusnus in #348
- Build(deps-dev): Bump pytest-subtests from 0.13.0 to 0.13.1 by @dependabot in #349
New Contributors
- @yenshirak made their first contribution in #339
Full Changelog: v1.0.0...v1.0.1
v1.0.0
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
What's Changed
- Improved the celery bug report doc by @Nusnus in #272
- Hotfix: Cleanups by @Nusnus in #273
- Bump cleanpy from 0.4.0 to 0.5.0 by @dependabot in #274
- Hotfix: Doc typo by @Nusnus in #275
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #276
- Build(deps-dev): Bump types-redis from 4.6.0.20240311 to 4.6.0.20240409 by @dependabot in #277
- Hotfix: Added gevent extra to built in worker by @Nusnus in #278
- Docs Enhancements by @Nusnus in #279
- Doc: Removed "Documentation under construction!" by @Nusnus in #280
- Hotfix: Lint error fix by @Nusnus in #281
- Updated sponsorship configurations by @Nusnus in #282
- Docs: Added main README documentation by @Nusnus in #283
- Prepare for (pre) release: v1.0.0rc4 by @Nusnus in #284
- Fixed PyPI README.rst errors that failed the automatic deployment to PyPI by @Nusnus in #285
Full Changelog: v1.0.0rc3...v1.0.0rc4
v1.0.0rc3
v1.0.0rc2
What's Changed
- Fixed CD by @Nusnus in #257
- Hotfix: New default worker tasks by @Nusnus in #259
- Hotfix: Added celery bug report snippet to CI by @Nusnus in #260
- New Doc: docs/devguide/sphinx.rst by @Nusnus in #261
- New Doc: docs/devguide/release.rst by @Nusnus in #262
- Hotfix: Enhanced Release Guide by @Nusnus in #263
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #265
- Bump pytest-cov from 4.1.0 to 5.0.0 by @dependabot in #264
- Prepare for (pre) release: v1.0.0rc2 by @Nusnus in #266
Full Changelog: v1.0.0rc1...v1.0.0rc2
v1.0.0rc1
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
andsolo
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.
- worker_pool: Using
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
- Added .github/CODEOWNERS by @Nusnus in #240
- New Example: examples/worker_pool by @Nusnus in #242
- Bumping Dependencies by @Nusnus in #243
- New Doc: docs/userguide/celery-bug-report.rst by @Nusnus in #244
- Bump coverage from 7.4.3 to 7.4.4 by @dependabot in #245
- New Example: examples/hybrid_setup by @Nusnus in #246
- Bugfix: node.config() didn't allow overriding by @Nusnus in #247
- Hotfix: Allow overriding node celery config with kwargs by @Nusnus in #249
- New Example: examples/vhost by @Nusnus in #248
- Bump black from 24.2.0 to 24.3.0 by @dependabot in #250
- New Doc: Useful Resources by @Nusnus in #251
- New Doc: Local Dev & Tox guides by @Nusnus in #253
- Hotfix: Fixed lint error in main by @Nusnus in #254
- Stabilized CI by @Nusnus in #255
- Prepare for (pre) release: v1.0.0rc1 by @Nusnus in #256
Full Changelog: v1.0.0b4...v1.0.0rc1