Skip to content

Commit

Permalink
test: Rework canvas call/errback integration tests
Browse files Browse the repository at this point in the history
This change modifies a bunch of the tests to use unique keys for the
`redis_echo` and `redis_count` tasks which are used to validate that
callbacks and errbacks are made. We also introduce helper functions for
validating that messages/counts are seen to reduce duplicate code.
  • Loading branch information
maybe-sybr committed May 17, 2021
1 parent ed8dc37 commit 1789097
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 190 deletions.
10 changes: 5 additions & 5 deletions t/integration/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,17 @@ def retry_once_priority(self, *args, expires=60.0, max_retries=1,


@shared_task
def redis_echo(message):
def redis_echo(message, redis_key="redis-echo"):
"""Task that appends the message to a redis list."""
redis_connection = get_redis_connection()
redis_connection.rpush('redis-echo', message)
redis_connection.rpush(redis_key, message)


@shared_task
def redis_count():
"""Task that increments a well-known redis key."""
def redis_count(redis_key="redis-count"):
"""Task that increments a specified or well-known redis key."""
redis_connection = get_redis_connection()
redis_connection.incr('redis-count')
redis_connection.incr(redis_key)


@shared_task(bind=True)
Expand Down
Loading

0 comments on commit 1789097

Please sign in to comment.