Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add REST API GET, POST, PATCH tests for cloud storage #4353

Merged
merged 31 commits into from
Mar 24, 2022

Conversation

Marishka17
Copy link
Contributor

@Marishka17 Marishka17 commented Feb 16, 2022

Motivation and context

PR contains REST API tests for cloud storage functionality
Resolves #3996

How has this been tested?

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2022 Intel Corporation
#
# SPDX-License-Identifier: MIT

@Marishka17 Marishka17 requested a review from nmanovic February 16, 2022 20:55
@Marishka17 Marishka17 requested a review from azhavoro as a code owner February 16, 2022 20:55
@Marishka17 Marishka17 changed the title Add REST API GET, POST, PATCH tests for cloud storage [WIP] Add REST API GET, POST, PATCH tests for cloud storage Feb 17, 2022
@Marishka17 Marishka17 changed the title [WIP] Add REST API GET, POST, PATCH tests for cloud storage Add REST API GET, POST, PATCH tests for cloud storage Feb 17, 2022
@nmanovic
Copy link
Contributor

@Marishka17 , could you please merge develop and share your experience about the process? I see that you have conflicts with cvat_data.tar.bz2, cvat_db.sql.

@nmanovic
Copy link
Contributor

@kirill-sizov , could you please review the patch and provide your suggestions.

@sizov-kirill
Copy link
Contributor

sizov-kirill commented Feb 18, 2022

@Marishka17 When I run these tests locally they fails, for example this test failed due to status code is 400

FAILED test_cloud_storages.py::TestPostCloudStorage::test_sandbox_user_create_cloud_storage[user-True]

Am I doing something wrong? Maybe I need to change something in my setup? Have you met this problem?

@Marishka17
Copy link
Contributor Author

@Marishka17 When I run these tests locally they fails, for example this test failed due to status code is 400

FAILED test_cloud_storages.py::TestPostCloudStorage::test_sandbox_user_create_cloud_storage[user-True]

Am I doing something wrong? Maybe I need to change something in my setup?

You need to export TESTING environment variable and run docker containers with -f docker-compose.testing.yml option.

@pytest.mark.parametrize('org_id', [2])
@pytest.mark.parametrize('storage_id', [2])
@pytest.mark.parametrize('role, is_owner, is_allow', [
#('worker', True, True),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to skip this test?

@Marishka17 Marishka17 changed the title Add REST API GET, POST, PATCH tests for cloud storage [WIP] Add REST API GET, POST, PATCH tests for cloud storage Feb 24, 2022
@Marishka17 Marishka17 requested a review from bsekachev as a code owner March 14, 2022 08:00
@Marishka17
Copy link
Contributor Author

@kirill-sizov, Could you please help and resolve conflicts with assets?

@Marishka17
Copy link
Contributor Author

Marishka17 commented Mar 16, 2022

@nmanovic, I've changed approach with test cloud storage functionality. Main idea is use Multi-Cloud Object Storage. Now, before running REST API tests MinIO server is started and MinIO client creates several buckets locally that are used in tests.
I'm removing WIP status now because I've mostly done all (maybe I will do only some cosmetics edits) and want to be sure that tests will be passed on CI as locally after resolving conflicts.

@Marishka17 Marishka17 changed the title [WIP] Add REST API GET, POST, PATCH tests for cloud storage Add REST API GET, POST, PATCH tests for cloud storage Mar 16, 2022
@sizov-kirill
Copy link
Contributor

@kirill-sizov, Could you please help and resolve conflicts with assets?

Yes sure, I will resolve conflicts.

@Marishka17 Marishka17 force-pushed the mk/cloud_storage_tests branch from ff0087b to 8091cd9 Compare March 18, 2022 08:18
@Marishka17 Marishka17 force-pushed the mk/cloud_storage_tests branch from 8091cd9 to 4292b34 Compare March 18, 2022 08:47
tests/rest_api/setup Outdated Show resolved Hide resolved
tests/rest_api/setup Outdated Show resolved Hide resolved
tests/rest_api/test_cloud_storages.py Outdated Show resolved Hide resolved
tests/rest_api/test_cloud_storages.py Outdated Show resolved Hide resolved
Copy link
Contributor

@sizov-kirill sizov-kirill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Marishka17 , great job!

@nmanovic nmanovic merged commit 2a05316 into develop Mar 24, 2022
@nmanovic nmanovic deleted the mk/cloud_storage_tests branch March 24, 2022 12:08
amteusch pushed a commit to amteusch/cvat that referenced this pull request Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for S3 compatible storage providers (eg MinIO)
3 participants