8000 Update test assets for quality tests by klakhov · Pull Request #8763 · cvat-ai/cvat · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update test assets for quality tests #8763

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

Merged
merged 5 commits into from
Dec 6, 2024
Merged

Conversation

klakhov
Copy link
Contributor
@klakhov klakhov commented Dec 2, 2024

Motivation and context

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • [ ] I have created a changelog fragment
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)
  • [ ] I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

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.

Summary by CodeRabbit

  • New Features
    • Enhanced task configuration options with additional parameters for more specific task handling.
  • Bug Fixes
    • Improved functionality of the task specification to conditionally include relevant properties based on new parameters.

@klakhov klakhov requested a review from azhavoro as a code owner December 2, 2024 09:52
Copy link
Contributor
coderabbitai bot commented Dec 2, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes involve modifications to the defaultTaskSpec function in the tests/cypress/support/default-specs.js file. Three new parameters—startFrame, frameFilter, and segmentSize—have been added to the function's signature. The taskSpec and dataSpec objects are updated to conditionally include new properties based on the presence of these parameters, enhancing the function's ability to handle more specific task configurations.

Changes

File Path Change Summary
tests/cypress/support/default-specs.js Updated defaultTaskSpec function to include new parameters: startFrame, frameFilter, segmentSize. Modified taskSpec and dataSpec to conditionally include properties based on these parameters.

Poem

In the land of code where rabbits play,
New parameters hop in, brightening the day.
With startFrame and filter, tasks take flight,
Enhancing our specs, oh what a delight!
So here’s to the changes, let’s give a cheer,
For clearer configurations, we hold dear! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@klakhov klakhov added the tests label Dec 2, 2024
@klakhov klakhov requested a review from bsekachev December 2, 2024 09:52
Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
tests/cypress/support/default-specs.js (2)

9-11: LGTM! Consider adding JSDoc documentation.

The new parameters are well-organized and maintain backward compatibility. However, adding JSDoc documentation would help other developers understand the purpose and expected values of these parameters.

Example documentation:

+ /**
+  * Generates default task specification for testing
+  * @param {Object} params - Task specification parameters
+  * @param {string} params.labelName - Name of the label
+  * @param {string} params.taskName - Name of the task
+  * @param {string[]} params.serverFiles - List of files on server
+  * @param {number} [params.startFrame] - Starting frame number
+  * @param {string} [params.frameFilter] - Frame filter expression
+  * @param {number} [params.segmentSize] - Size of task segments
+  * @param {Object} [params.validationParams] - Validation parameters
+  * @returns {Object} Task specification object
+  */

35-40: LGTM! Consider adding input validation.

The implementation correctly handles frame-related parameters. However, since these parameters are critical for frame selection, consider adding basic validation:

  • startFrame should be a non-negative integer
  • frameFilter should be a valid filter expression
     if (startFrame) {
+        if (!Number.isInteger(startFrame) || startFrame < 0) {
+            throw new Error('startFrame must be a non-negative integer');
+        }
         dataSpec.start_frame = startFrame;
     }
     if (frameFilter) {
+        if (typeof frameFilter !== 'string' || !frameFilter.trim()) {
+            throw new Error('frameFilter must be a non-empty string');
+        }
         dataSpec.frame_filter = frameFilter;
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0c57d24 and ad81c25.

📒 Files selected for processing (1)
  • tests/cypress/support/default-specs.js (2 hunks)
🔇 Additional comments (1)
tests/cypress/support/default-specs.js (1)

24-26: LGTM! Verify segment size constraints.

The implementation correctly adds the segment_size parameter when provided. However, it might be worth verifying if there are any constraints on the segment size value in CVAT.

✅ Verification successful

Based on the search results, I can provide a final response since I have enough information about segment size constraints and usage in CVAT:

Segment size implementation is correct and follows CVAT's design

The segment size parameter is used to divide datasets into smaller parts for concurrent annotation by multiple annotators. The implementation correctly:

  • Accepts any positive integer value without hard constraints
  • Divides the task into segments based on the specified size
  • Handles segment size appropriately for both video and image datasets
  • Integrates with other parameters like overlap size and chunk size
  • Is used consistently across the codebase for job segmentation

The test cases demonstrate proper handling of various segment sizes (1, 3, 4, 5, 10, etc.) without any validation issues. The parameter is well-documented and its behavior aligns with CVAT's task management design.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any segment size validation or constraints in the codebase
rg -g '!*.{json,lock}' -i 'segment.*size' -A 5 -B 5

Length of output: 81744

@codecov-commenter
Copy link
codecov-commenter commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.92%. Comparing base (ebe3dd6) to head (5a64e2e).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8763   +/-   ##
========================================
  Coverage    73.92%   73.92%           
========================================
  Files          409      409           
  Lines        43944    43945    +1     
  Branches      3985     3985           
========================================
+ Hits         32485    32488    +3     
+ Misses       11459    11457    -2     
Components Coverage Δ
cvat-ui 78.35% <ø> (+<0.01%) ⬆️
cvat-server 70.13% <100.00%> (+<0.01%) ⬆️

Copy link
sonarqubecloud bot commented Dec 6, 2024

@klakhov klakhov merged commit b5c0971 into develop Dec 6, 2024
35 checks passed
@bsekachev bsekachev deleted the kl/update-quality-tests branch December 11, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0