Skip to content

Commit

Permalink
Merge pull request #122 from allburov/test-task-sent-total
Browse files Browse the repository at this point in the history
Add tests for celery_task_sent_total
  • Loading branch information
danihodovic authored Jun 28, 2022
2 parents 1534d70 + 2a114cc commit 653b266
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def run():
)

threading.Thread(target=run, daemon=True).start()
time.sleep(2)

@celery_app.task
def succeed():
Expand All @@ -43,6 +44,14 @@ def fail():
assert res.status_code == 200

# pylint: disable=line-too-long
assert (
f'celery_task_sent_total{{hostname="{celery_worker.hostname}",name="src.test_cli.succeed"}} 2.0'
in res.text
)
assert (
f'celery_task_sent_total{{hostname="{celery_worker.hostname}",name="src.test_cli.fail"}} 1.0'
in res.text
)
assert (
f'celery_task_received_total{{hostname="{celery_worker.hostname}",name="src.test_cli.succeed"}} 2.0'
in res.text
Expand Down

0 comments on commit 653b266

Please sign in to comment.