Skip to content

Commit

Permalink
feat: preheat remove piece length (#381)
Browse files Browse the repository at this point in the history
Signed-off-by: zhaoxinxin <[email protected]>
  • Loading branch information
Liam-Zhao committed Aug 16, 2024
1 parent 800c37a commit 9b38889
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 174 deletions.
29 changes: 0 additions & 29 deletions cypress/e2e/job/preheats/create-preheat.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,35 +269,6 @@ describe('Create preheat', () => {
cy.get('#url').clear();
cy.get('#url').type('https://docs');

// Should display message pieceLength the validation error.
cy.get('#pieceLength').clear();

cy.get('#save').click();
cy.get('#pieceLength-helper-text')
.should('be.visible')
.and('have.text', 'Fill in the number, the length is 4-1024 MiB.');

cy.get('#pieceLength').type('3');

cy.get('#save').click();

// Show verification error message.
cy.get('#pieceLength-helper-text')
.should('be.visible')
.and('have.text', 'Fill in the number, the length is 4-1024 MiB.');

cy.get('#pieceLength').clear();
cy.get('#pieceLength').type('1025');
// Show verification error message.
cy.get('#pieceLength-helper-text')
.should('be.visible')
.and('have.text', 'Fill in the number, the length is 4-1024 MiB.');

cy.get('#pieceLength').clear();
cy.get('#pieceLength').type('10');

cy.get('#pieceLength-helper-text').should('not.exist');

// Should display message tag the validation error.
cy.get('#tag').type(url);

Expand Down
29 changes: 10 additions & 19 deletions cypress/e2e/job/preheats/preheat.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,19 @@ describe('Preheat', () => {

cy.get(':nth-child(4) > .show_informationContent__wKGxa').should('have.text', 'http://dock.io/preheat/test');

// Show preheat Piece Length.
cy.get(':nth-child(5) > .show_informationContent__wKGxa').should('have.text', '1002 MiB');

// Show preheat filter.
cy.get(':nth-child(6) > .show_informationContent__wKGxa').children().should('have.length', 2);
cy.get(':nth-child(5) > .show_informationContent__wKGxa').children().should('have.length', 2);

cy.get(':nth-child(6) > .show_informationContent__wKGxa > :nth-child(1) > .MuiChip-label').should(
cy.get(':nth-child(5) > .show_informationContent__wKGxa > :nth-child(1) > .MuiChip-label').should(
'have.text',
'Expires',
);

// Show preheat tag.
cy.get(':nth-child(7) > .show_informationContent__wKGxa').should('have.text', 'prheat tag');
cy.get(':nth-child(6) > .show_informationContent__wKGxa').should('have.text', 'prheat tag');

// Show preheat hearder.
cy.get(':nth-child(8) > .MuiPaper-root').children().should('have.length', 1);
cy.get(':nth-child(7) > .MuiPaper-root').children().should('have.length', 1);

cy.get('.css-172ywp3').should('have.text', 'Connection');
cy.get('.css-ft9ciy').should('have.text', 'keep-alive');
Expand All @@ -119,7 +116,7 @@ describe('Preheat', () => {
cy.get('.show_schedulerClustersID__iQd1s').should('have.text', 1);

// Show preheat Created At.
cy.get(':nth-child(10) > .MuiChip-root').should('have.text', '2023-12-13 19:58:53');
cy.get(':nth-child(9) > .MuiChip-root').should('have.text', '2023-12-13 19:58:53');

// Click the show error log button.
cy.get('#status > .MuiButtonBase-root').click();
Expand All @@ -142,9 +139,6 @@ describe('Preheat', () => {
// Show preheat id.
cy.get(':nth-child(1) > .show_informationContent__wKGxa').should('have.text', 8);

// Show piece lenght.
cy.get(':nth-child(5) > .show_informationContent__wKGxa').should('have.text', '4 MiB');

// Show preheat status.
cy.get('#status')
.should('have.text', 'SUCCESS')
Expand All @@ -153,7 +147,7 @@ describe('Preheat', () => {
.and('not.exist');

// Show preheat hearder.
cy.get(':nth-child(8) > .MuiPaper-root').children().should('have.length', 2);
cy.get(':nth-child(7) > .MuiPaper-root').children().should('have.length', 2);
});

it('should display detailed preheat pending information', () => {
Expand Down Expand Up @@ -192,7 +186,7 @@ describe('Preheat', () => {
.and('not.exist');

// Show preheat hearder.
cy.get(':nth-child(8) > .MuiPaper-root').children().should('have.length', 1);
cy.get(':nth-child(7) > .MuiPaper-root').children().should('have.length', 1);

cy.wait(6000);

Expand Down Expand Up @@ -268,9 +262,6 @@ describe('Preheat', () => {

cy.get('.css-2imjyh > .MuiTypography-root').should('have.text', '-');

// Show preheat piece lenght.
cy.get(':nth-child(5) > .show_informationContent__wKGxa').should('have.text', '0 MiB');

// Show preheat tag.
cy.get(':nth-child(6) > .show_informationContent__wKGxa.MuiBox-root > .MuiTypography-root').should(
'have.text',
Expand All @@ -284,7 +275,7 @@ describe('Preheat', () => {
cy.get('.show_schedulerClustersID__iQd1s').should('have.text', '-');

// Show preheat Created At.
cy.get(':nth-child(10) > .show_informationContent__wKGxa').should('have.text', '-');
cy.get(':nth-child(9) > .show_informationContent__wKGxa').should('have.text', '-');
});
});

Expand Down Expand Up @@ -350,7 +341,7 @@ describe('Preheat', () => {
cy.get('.show_schedulerClustersID__iQd1s').should('have.text', '-');

// Show preheat Created At.
cy.get(':nth-child(10) > .show_informationContent__wKGxa').should('have.text', '-');
cy.get(':nth-child(9) > .show_informationContent__wKGxa').should('have.text', '-');
});

it('when the status is pending, preheat API error response', () => {
Expand Down Expand Up @@ -389,7 +380,7 @@ describe('Preheat', () => {
.and('not.exist');

// Show preheat hearder.
cy.get(':nth-child(8) > .MuiPaper-root').children().should('have.length', 1);
cy.get(':nth-child(7) > .MuiPaper-root').children().should('have.length', 1);

cy.wait(6000);

Expand Down
10 changes: 0 additions & 10 deletions cypress/fixtures/job/preheats/create-preheat.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -70,7 +69,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -126,7 +124,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -182,7 +179,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -238,7 +234,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -294,7 +289,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -350,7 +344,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -406,7 +399,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -462,7 +454,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -518,7 +509,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down
1 change: 0 additions & 1 deletion cypress/fixtures/job/preheats/failure-preheat.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"Connection": "keep-alive"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "prheat tag",
"type": "file",
Expand Down
4 changes: 0 additions & 4 deletions cypress/fixtures/job/preheats/failure-preheats.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -70,7 +69,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -126,7 +124,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -182,7 +179,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down
1 change: 0 additions & 1 deletion cypress/fixtures/job/preheats/pagination-preheats.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down
1 change: 0 additions & 1 deletion cypress/fixtures/job/preheats/pending-preheat.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"Connection": "keep-alive"
},
"password": "",
"pieceLength": 4194304,
"platform": "",
"tag": "prheat tag",
"type": "file",
Expand Down
1 change: 0 additions & 1 deletion cypress/fixtures/job/preheats/pending-preheats.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down
10 changes: 0 additions & 10 deletions cypress/fixtures/job/preheats/preheats.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -70,7 +69,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -126,7 +124,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -182,7 +179,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -238,7 +234,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -294,7 +289,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -350,7 +344,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -406,7 +399,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -462,7 +454,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down Expand Up @@ -518,7 +509,6 @@
"Authorization": "Bearer yJhbGciOiJSUzI1NiIsImtpZCI6IjNEWT"
},
"password": "",
"pieceLength": 1050673152,
"platform": "",
"tag": "",
"type": "file",
Expand Down
1 change: 0 additions & 1 deletion cypress/fixtures/job/preheats/success-preheat.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"Connection": "keep-alive"
},
"password": "",
"pieceLength": 4194304,
"platform": "",
"tag": "",
"type": "file",
Expand Down
Loading

0 comments on commit 9b38889

Please sign in to comment.