You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Selwin Ong 5b95725dc4
Dependency with failures (#1681)
* added Dependency class with allow_failures

* Requested changes

* Check type before setting `job.dependency_allow_fail` within `Job.create`

* Set `job.dependency_allow_fail` within `Job.create`

* Added test to ensure persistence of `dependency_allow_fail`

* Removed typing and allow mixed list of ints and Job objects

* Convert dependency_allow_fail boolean to integer during serialization to avoid redis DataError

* Updated `test_multiple_dependencies_are_accepted_and_persisted` test to include `Dependency` cases

* Adding placeholder test to test actual behavior of new `Dependency` usage in `depends_on`

* Updated `test_job_dependency` to include cases using `Dependency`

* Added dependency_allow_fail logic to `Job.restore`

* Renamed `dependency_allow_fail` to a simpler `allow_failure`

* Update docs to add section about the new `Dependency` class and use-case

* Updated `Job.dependencies_are_met` logic to take `FAILED` and `STOPPED` jobs into account when `allow_failure=True`

* Updated `test_job_dependency` test. Still failing with `Dependency` case.

* Fix `allow_failure` type coercion in `Job.restore`

* Re-arrange tests, so default `Dependency.allow_failure` is before explicit `allow_failure=True`

* Fixed Dependency, so it works correctly when allow_failure=True

* Attempt to execute pipeline prior to queueing a failed job's dependents. test_create_and_cancel_job_enqueue_dependents_in_registry test now passes.

* Added `Depedency` test utilizing multiple dependencies

* Removed irrelevant on_success and on_failure keyword arguments in example

* Replaced use of long_running_job

* Add test to verify `Dependency.jobs` contraints

* Suppress connection error in handle_job_failure

* test_dependencies have passed

* All tests pass if enqueue_dependents called without pipeline.watch()

* All tests now pass

* Removed print statements

* Cleanup Dependency implementation

* Renamed job.allow_failure to job.allow_dependency_failures

Co-authored-by: mattchan <mattchan@tencent.com>
Co-authored-by: Mike Hill <mhilluniversal@gmail.com>
2 years ago
..
config_files Drop python2-specific syntax (#1674) 2 years ago
ssl_config Fix RQScheduler when run with SSL connection (#1383) 4 years ago
Dockerfile Docker (#1471) 4 years ago
__init__.py Drop python2-specific syntax (#1674) 2 years ago
fixtures.py docs: Fix a few typos (#1679) 2 years ago
test.json Allows enqueueing by the cli (#1466) 3 years ago
test_callbacks.py Jobs that are run synchronously should always raise an exception (#1671) 3 years ago
test_cli.py Drop python2-specific syntax (#1674) 2 years ago
test_commands.py Respect serializer (#1538) 3 years ago
test_connection.py Drop python2-specific syntax (#1674) 2 years ago
test_decorator.py Drop python2-specific syntax (#1674) 2 years ago
test_dependencies.py Dependency with failures (#1681) 2 years ago
test_fixtures.py Drop python2-specific syntax (#1674) 2 years ago
test_helpers.py Restored the ability to specify connection params in config 10 years ago
test_job.py Dependency with failures (#1681) 2 years ago
test_queue.py Drop python2-specific syntax (#1674) 2 years ago
test_registry.py Drop python2-specific syntax (#1674) 2 years ago
test_retry.py Make unstable tests more stable (#1523) 3 years ago
test_scheduler.py Use unittest.mock instead of mock (#1673) 2 years ago
test_sentry.py Drop python2-specific syntax (#1674) 2 years ago
test_serializers.py Drop python2-specific syntax (#1674) 2 years ago
test_timeouts.py Cross platform simple worker (#1629) 3 years ago
test_utils.py Drop python2-specific syntax (#1674) 2 years ago
test_worker.py Dependency with failures (#1681) 2 years ago
test_worker_registration.py Use unittest.mock instead of mock (#1673) 2 years ago