#803 test webhook methods
Closed: Fixed 3 months ago by praiskup. Opened 11 months ago by praiskup.

We should add unit-tests for:

[ ] pagure-events.py - event_info_from_pr_comment, event_info_from_push, event_info_from_pr
[ ] coprs/views/webhooks_ns/webhooks_general.py - github/gitlab/bitbucket


Metadata Update from @praiskup:
- Issue assigned to praiskup

6 months ago

Metadata Update from @praiskup:
- Issue assigned to schlupov (was: praiskup)

6 months ago

I've seen this in production. It needs diagnose and maybe even a test:

2019-12-05 08:45:09,228 [ERROR][/usr/lib/python3.7/site-packages/flask/app.py:1761|app:log_exception] Exception on /webhooks/github/6575/2abf9f6d-65c2-4a98-8c99-5a3f5cc951e7/ [POST]
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/share/copr/coprs_frontend/coprs/rest_api/__init__.py", line 44, in error_router
    return original_handler(e)
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/share/copr/coprs_frontend/coprs/views/webhooks_ns/webhooks_general.py", line 136, in webhooks_git_push
    clone_url = payload['repository']['clone_url']
TypeError: 'NoneType' object is not subscriptable

Metadata Update from @praiskup:
- Issue status updated to: Open (was: Closed)

5 months ago

Metadata Update from @praiskup:
- Issue status updated to: Open (was: Closed)

4 months ago

We still need a test for pagure events, that particular events really trigger new builds.

Commit d00145c relates to this ticket

Commit 79baf27 relates to this ticket

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #1266 Merged 3 months ago
  • #1234 Merged 3 months ago
  • #1191 Merged 4 months ago
  • #1161 Merged 4 months ago
  • #1122 Merged 5 months ago