|
| 1 | +Feature: Celery |
| 2 | + |
| 3 | +Scenario Outline: Handled exceptions are delivered in Celery <celery-version> |
| 4 | + Given I start the service "celery-<celery-version>" |
| 5 | + When I execute the command "python bugsnag_celery_test_app/queue_task.py handled" in the service "celery-<celery-version>" |
| 6 | + And I wait to receive an error |
| 7 | + Then the error is valid for the error reporting API version "4.0" for the "Python Bugsnag Notifier" notifier |
| 8 | + And the exception "errorClass" equals "Exception" |
| 9 | + And the exception "message" equals "oooh nooo" |
| 10 | + And the event "unhandled" is false |
| 11 | + And the event "severity" equals "warning" |
| 12 | + And the event "severityReason.type" equals "handledException" |
| 13 | + And the event "device.runtimeVersions.celery" matches "<celery-version>\.\d+\.\d+" |
| 14 | + |
| 15 | + @not-python-3.11 @not-python-3.12 |
| 16 | + Examples: |
| 17 | + | celery-version | |
| 18 | + | 4 | |
| 19 | + |
| 20 | + @not-python-3.5 |
| 21 | + Examples: |
| 22 | + | celery-version | |
| 23 | + | 5 | |
| 24 | + |
| 25 | +Scenario Outline: Unhandled exceptions are delivered in Celery <celery-version> |
| 26 | + Given I start the service "celery-<celery-version>" |
| 27 | + When I execute the command "python bugsnag_celery_test_app/queue_task.py unhandled" in the service "celery-<celery-version>" |
| 28 | + And I wait to receive an error |
| 29 | + Then the error is valid for the error reporting API version "4.0" for the "Python Bugsnag Notifier" notifier |
| 30 | + And the exception "errorClass" equals "KeyError" |
| 31 | + And the exception "message" equals "'b'" |
| 32 | + And the event "unhandled" is true |
| 33 | + And the event "severity" equals "error" |
| 34 | + And the event "severityReason.type" equals "unhandledExceptionMiddleware" |
| 35 | + And the event "severityReason.attributes.framework" equals "Celery" |
| 36 | + And the event "device.runtimeVersions.celery" matches "<celery-version>\.\d+\.\d+" |
| 37 | + And the event "context" equals "bugsnag_celery_test_app.tasks.unhandled" |
| 38 | + And the event "metaData.extra_data.task_id" is not null |
| 39 | + # these aren't strings but the maze runner step works on arrays and hashes |
| 40 | + And the event "metaData.extra_data.args" string is empty |
| 41 | + And the event "metaData.extra_data.kwargs" string is empty |
| 42 | + |
| 43 | + @not-python-3.11 @not-python-3.12 |
| 44 | + Examples: |
| 45 | + | celery-version | |
| 46 | + | 4 | |
| 47 | + |
| 48 | + @not-python-3.5 |
| 49 | + Examples: |
| 50 | + | celery-version | |
| 51 | + | 5 | |
| 52 | + |
| 53 | +Scenario Outline: Task arguments are added to metadata in Celery <celery-version> |
| 54 | + Given I start the service "celery-<celery-version>" |
| 55 | + When I execute the command "python bugsnag_celery_test_app/queue_task.py add 1 2 3 '4' a=100 b=200" in the service "celery-<celery-version>" |
| 56 | + And I wait to receive an error |
| 57 | + Then the error is valid for the error reporting API version "4.0" for the "Python Bugsnag Notifier" notifier |
| 58 | + And the exception "errorClass" equals "AssertionError" |
| 59 | + And the exception "message" equals "" |
| 60 | + And the event "unhandled" is true |
| 61 | + And the event "severity" equals "error" |
| 62 | + And the event "severityReason.type" equals "unhandledExceptionMiddleware" |
| 63 | + And the event "severityReason.attributes.framework" equals "Celery" |
| 64 | + And the event "device.runtimeVersions.celery" matches "<celery-version>\.\d+\.\d+" |
| 65 | + And the event "context" equals "bugsnag_celery_test_app.tasks.add" |
| 66 | + And the event "metaData.extra_data.task_id" is not null |
| 67 | + And the error payload field "events.0.metaData.extra_data.args" is an array with 4 elements |
| 68 | + And the event "metaData.extra_data.args.0" equals "1" |
| 69 | + And the event "metaData.extra_data.args.1" equals "2" |
| 70 | + And the event "metaData.extra_data.args.2" equals "3" |
| 71 | + And the event "metaData.extra_data.args.3" equals "4" |
| 72 | + And the event "metaData.extra_data.kwargs.a" equals "100" |
| 73 | + And the event "metaData.extra_data.kwargs.b" equals "200" |
| 74 | + |
| 75 | + @not-python-3.11 @not-python-3.12 |
| 76 | + Examples: |
| 77 | + | celery-version | |
| 78 | + | 4 | |
| 79 | + |
| 80 | + @not-python-3.5 |
| 81 | + Examples: |
| 82 | + | celery-version | |
| 83 | + | 5 | |
| 84 | + |
| 85 | +Scenario Outline: Errors in shared tasks are reported in Celery <celery-version> |
| 86 | + Given I start the service "celery-<celery-version>" |
| 87 | + When I execute the command "python bugsnag_celery_test_app/queue_task.py divide 10 0" in the service "celery-<celery-version>" |
| 88 | + And I wait to receive an error |
| 89 | + Then the error is valid for the error reporting API version "4.0" for the "Python Bugsnag Notifier" notifier |
| 90 | + And the exception "errorClass" equals "ZeroDivisionError" |
| 91 | + And the exception "message" equals "division by zero" |
| 92 | + And the event "unhandled" is true |
| 93 | + And the event "severity" equals "error" |
| 94 | + And the event "severityReason.type" equals "unhandledExceptionMiddleware" |
| 95 | + And the event "severityReason.attributes.framework" equals "Celery" |
| 96 | + And the event "device.runtimeVersions.celery" matches "<celery-version>\.\d+\.\d+" |
| 97 | + And the event "context" equals "bugsnag_celery_test_app.tasks.divide" |
| 98 | + And the event "metaData.extra_data.task_id" is not null |
| 99 | + And the error payload field "events.0.metaData.extra_data.args" is an array with 2 elements |
| 100 | + And the event "metaData.extra_data.args.0" equals "10" |
| 101 | + And the event "metaData.extra_data.args.1" equals "0" |
| 102 | + And the event "metaData.extra_data.kwargs" string is empty |
| 103 | + |
| 104 | + @not-python-3.11 @not-python-3.12 |
| 105 | + Examples: |
| 106 | + | celery-version | |
| 107 | + | 4 | |
| 108 | + |
| 109 | + @not-python-3.5 |
| 110 | + Examples: |
| 111 | + | celery-version | |
| 112 | + | 5 | |
| 113 | + |
| 114 | +Scenario Outline: Successful tasks do not report errors in Celery <celery-version> |
| 115 | + Given I start the service "celery-<celery-version>" |
| 116 | + When I execute the command "python bugsnag_celery_test_app/queue_task.py add 1 2 3 4 5 6 7 a=8 b=9" in the service "celery-<celery-version>" |
| 117 | + Then I should receive no errors |
| 118 | + |
| 119 | + @not-python-3.11 @not-python-3.12 |
| 120 | + Examples: |
| 121 | + | celery-version | |
| 122 | + | 4 | |
| 123 | + |
| 124 | + @not-python-3.5 |
| 125 | + Examples: |
| 126 | + | celery-version | |
| 127 | + | 5 | |
| 128 | + |
| 129 | +Scenario Outline: Successful shared tasks do not report errors in Celery <celery-version> |
| 130 | + Given I start the service "celery-<celery-version>" |
| 131 | + When I execute the command "python bugsnag_celery_test_app/queue_task.py divide 10 2" in the service "celery-<celery-version>" |
| 132 | + Then I should receive no errors |
| 133 | + |
| 134 | + @not-python-3.11 @not-python-3.12 |
| 135 | + Examples: |
| 136 | + | celery-version | |
| 137 | + | 4 | |
| 138 | + |
| 139 | + @not-python-3.5 |
| 140 | + Examples: |
| 141 | + | celery-version | |
| 142 | + | 5 | |
0 commit comments