-
Notifications
You must be signed in to change notification settings - Fork 3k
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 tests for export job dataset #5160
Conversation
❌ Some checks failed |
/check |
❌ Some checks failed |
/check |
❌ Some checks failed |
tests/python/rest_api/test_jobs.py
Outdated
os.remove(temp_anno_file_name) | ||
|
||
@pytest.mark.parametrize("username, jid", [("admin1", 14)]) | ||
def test_check_exported_cvat_dataset_structure( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why only these two formats were tested?
- Could you try to avoid copy-paste programming? I suggest to use something similar to what we already have for task and, from recent update, for project export. It can easily be reproduced for jobs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only these two formats were tested?
I believe that in these tests 2 formats will be enough because tests should check that the annotation file contains only job annotations (the dataset contains only job data) and not the entire task. If this is true for our format, then the same for the others.
def __init__(self, pk): | ||
self.db_job = models.Job.objects.select_related('segment__task') \ | ||
.select_for_update().get(id=pk) | ||
def __init__(self, pk, is_prefetched=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new argument is unclear to me - when and why it should be used? I don't see how the fact the data is (was?) prefetched affects this class, except it might work slightly more optmizied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also affects the sorting of images in the annotation file in cvat format. (We can get sorted sequence from db or sort in code, but I've chosen this approach because we use it for tasks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this answers the questions above.
We can get sorted sequence from db or sort in code, but I've chosen this approach because we use it for tasks
I see that sorting is performed in the newly added code when frames are fetched from DB. The DB itself doesn't impose any sorting.
/check |
🚫 Workflows has been canceled |
Motivation and context
Added REST API tests to export job datasets & annotations and validate their structure.
How has this been tested?
Checklist
develop
branch- [ ] I have updated the documentation accordingly- [ ] I have linked related issues (read github docs)- [ ] I have increased versions of npm packages if it is necessary (cvat-canvas,cvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.