8 Commits (4c32be5c9b126ef9718e5d3f10c27842b7edb580)

Author SHA1 Message Date
Maxim Zhiltsov 0280b5fb64
Add simple filters for collections (#5575)
Added simple filter queries for collections in the server API. Such
queries should cover simpler cases, while more complex filters should
use the JSON syntax.

- Added simple filters for collection endpoints in API (e.g.
`/tasks?project_id=42&user=myusername`)
- Removed duplicating collection endpoints in API in favor of their full
versions:
  - `/projects/{id}/tasks` -> `/tasks?project_id={id}`
  - `/tasks/{id}/jobs` -> `/jobs?task_id={id}`
  - `/jobs/{id}/issues` -> `/issues?job_id={id}`
  - `/issue/{id}/comments` -> `/comments?issue_id={id}`
  - Corresponding owning objects now return a link to the collection:
    - `/projects/{id}`: `.tasks`
    - `/tasks/{id}`: `.jobs`
    - `/jobs/{id}`: `.issues`
    - `/issue/{id}`: `.comments`
- Fixed errors in the generated server API schema:
- Input and output types in all the basic model methods (`Create`,
`Update`, `Retrieve`, `Delete`)
- Removed invalid separation for the project list operation response
type
- File structure for projects in the dataset cache is updated to store
the new project representation. Old caches will be invalidated.
- Added tests
3 years ago
Kirill Sizov 7b86ed814e
Use 'ParseError' instead of 'BadRequest' (#5625)
When we use `BadRequest` our responses doesn't contain error message, so
it's better to use exceptions from `rest_framework.exceptions`
3 years ago
Kirill Sizov 4e3d81ccae
Fix webhooks (#5611) 3 years ago
Maxim Zhiltsov af65707eee
Mark tests that require external services (#5474)
Related: #5225 

External services are not available when we execute in Helm.

- Added a way to mark REST API tests that require external services to
run
- Changed the way of filtering tests in Helm tests

Currently, we can't execute external service mocks in tests, and we
ignore related tests in the Helm
execution command. But this command may be outdated, because Helm tests
are not executed in each PR.
This PR allows to indicate related tests and filter them out without the
need to synchronize the CI command.
3 years ago
Kirill Sizov ce09f28512
Fix SDK tests: login once per class (#5123) 3 years ago
Kirill Sizov bcb3f9bda8
Tests for Webhook sender (#5017)
* tests/rest_api/assets: update webhooks in testdb

* tests/rest_api/test_webhook_sender: add tests for project and ping events

* tests/rest_api/test_webhook_sender: add tests for webhook intersection case

* tests/rest_api/test_webhook_sender: add tests for task update events

* tests/rest_api/test_webhook_sender: add tests for task create and job update events

* tests/rest_api/test_webhook_sender: add tests for issue events

* tests/rest_api/test_webhook_sender: add tests for membership events

* tests/rest_api/test_webhook_sender: add tests for organization event

* Fix Pylint warnings

* apps/engine: get rid of sending `create` signals in views

* apps/organizations: get rid of sending `create` signals in views

* tests/rest_api/test_webhooks: fix typo

* apps/engine: get rid of sending  signals in task view

* tests/rest_api: remove debug prints

* apps/engine: fix pylint errors

* tests/rest_api/test_webhooks_sender: add tests for `redelivery` method

* tests: define tag for minio image

* apps/webhooks: remove owner_id from write serializer

* tests/rest_api/test_webhooks: fix code style

* tests/rest_api: added tests for webhook comment events

* tests/rest_api: fix typo

Co-authored-by: Anastasia Yasakova <yasakova_anastasiya@mail.ru>

* tests: fix warnings from black

Co-authored-by: Anastasia Yasakova <yasakova_anastasiya@mail.ru>
3 years ago
Maxim Zhiltsov 6654366021
Autoformat python tests (#5021) 3 years ago
Kirill Sizov bae7564968
Add webhooks (#4863)
Co-authored-by: “klakhov” <kirill.lakhov@cvat.ai>
Co-authored-by: Boris <sekachev.bs@gmail.com>
Co-authored-by: kirill-sizov <kirill.sizov@intel.com>
3 years ago