-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Test consensus: merging, ver 2 #9193
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #9193 +/- ##
===========================================
+ Coverage 73.33% 73.61% +0.28%
===========================================
Files 449 449
Lines 45863 45863
Branches 3915 3915
===========================================
+ Hits 33633 33762 +129
+ Misses 12230 12101 -129
🚀 New features to boost your workflow:
|
const onSave = useCallback(() => { | ||
form.validateFields().then((values) => { | ||
setSettings(values); | ||
}).catch(() => { /* do nothing */ }); |
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.
Lets mark this PR as dependent on #9178. I have a proper fix for this problem with error notification
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.
done
tests/cypress/support/commands.js
Outdated
@@ -1833,3 +1846,30 @@ Cypress.Commands.add('applyActionToSliders', (wrapper, slidersClassNames, action | |||
}); | |||
cy.get('.ant-tooltip').invoke('hide'); | |||
}); | |||
|
|||
Cypress.Commands.add('mergeConsensusTask', (status = 202) => { | |||
cy.intercept('POST', '/api/consensus/merges**').as('mergeJobs'); |
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.
cy.intercept('POST', '/api/consensus/merges**').as('mergeJobs'); | |
cy.intercept('POST', '/api/consensus/merges**').as('mergeTask'); |
tests/cypress/support/commands.js
Outdated
Cypress.Commands.add('mergeConsensusJob', (status = 202) => { | ||
cy.intercept('POST', '/api/consensus/merges**').as('mergeJob'); | ||
|
||
cy.get('.cvat-job-item').first().within(() => { |
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 would be better to specify what job we want to merge, not just first one. Maybe ID parameter will work
// Save settings, confirm request is sent | ||
let requestCount = 0; | ||
cy.intercept('PATCH', 'api/consensus/settings/**', () => { | ||
requestCount++; |
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 dont think we need to check request count. By default its not supposed to be sent. There was no regressions where it was sent.
cy.get('#quorum').then(([$el]) => { | ||
cy.wrap($el).invoke('val').should('eq', `${defaultQuorum}`); | ||
cy.wrap($el).clear(); | ||
}); | ||
cy.get('.ant-form-item-explain-error').should('be.visible'); | ||
cy.contains('button', 'Save').click(); |
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 code is duplicated, if you want to check both fields, write a funciton for it
cy.get('.ant-notification-notice').should('not.exist'); | ||
|
||
// Go back to task page | ||
cy.get('.ant-btn-default').should('be.visible').click(); |
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.
Lets add a class inside <GoBackButton />
component so we dont adress it with .ant-btn-default
// Create annotations for job replicas | ||
const delta = 50; | ||
const [consensusJobID, ...replicaJobIDs] = jobIDs; | ||
for (let i = 0, s = shape; i < replicas; i++) { |
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.
Please, use more descriptive name than s
@@ -179,6 +179,7 @@ Cypress.Commands.add( | |||
expectedResult = 'success', | |||
projectSubsetFieldValue = 'Test', | |||
qualityConfigurationParams = null, | |||
serverFiles = [], |
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.
Not used anymore
@@ -212,7 +213,11 @@ Cypress.Commands.add( | |||
cy.get('.cvat-project-subset-field').type(`${projectSubsetFieldValue}{Enter}`); | |||
cy.get('.cvat-constructor-viewer-new-item').should('not.exist'); | |||
} | |||
cy.get('input[type="file"]').attachFile(image, { subjectType: 'drag-n-drop' }); | |||
if (serverFiles.length > 0) { |
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.
Same here
Co-authored-by: Kirill Lakhov <[email protected]>
Co-authored-by: Kirill Lakhov <[email protected]>
|
Depends on #9178
Motivation and context
Test coverage for merging feature in consensus jobs. Commits were cherry-picked from #9190
How has this been tested?
Case 1: check new merge buttons exist and are visible.
New freshly created jobs have status 'new'. Trying to merge new jobs should result in error notifications and a HTTP 400 status code. All notifications are closed before the next testcase
Case 2: Check consensus management page
Consensus management page has settings for consensus quorum and minimum annotation overlap. Check that the page has fields for both options. If a field is filled incorrectly the form turns red and a message appears under the form. Trying to save options with erroneous forms should do nothing - no requests are sent, no errors shown.
Case 3: Create annotations and check that job replicas merge correctly
Create annotations with one rectangle in job replicas. The rectangle is moved with a step in each job's first frame. This means that after merging, the consensus job will have a rectangle which has to fully match a rectangle inside the replica in the middle.
Checklist
develop
branchLicense
Feel free to contact the maintainers if that's a concern.