X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/d1fa1c888be0d956178cc29cd78dbb924a7606c1..25d64433dff3ffcf083c2cedd8d849de49a691d1:/cypress/integration/process.spec.js diff --git a/cypress/integration/process.spec.js b/cypress/integration/process.spec.js index 75c318db..faf70c49 100644 --- a/cypress/integration/process.spec.js +++ b/cypress/integration/process.spec.js @@ -95,7 +95,7 @@ describe('Process tests', function() { .then(function(containerRequest) { cy.loginAs(activeUser); cy.goToPath(`/processes/${containerRequest.uuid}`); - cy.get('[data-cy=process-info]').should('contain', crName); + cy.get('[data-cy=process-details]').should('contain', crName); cy.get('[data-cy=process-logs]') .should('contain', 'No logs yet') .and('not.contain', 'hello world'); @@ -191,4 +191,80 @@ describe('Process tests', function() { }); }); }); -}); \ No newline at end of file + + it('should show runtime status indicators', function() { + // Setup running container with runtime_status error & warning messages + createContainerRequest( + activeUser, + 'test_container_request', + 'arvados/jobs', + ['echo', 'hello world'], + false, 'Committed') + .as('containerRequest') + .then(function(containerRequest) { + expect(containerRequest.state).to.equal('Committed'); + expect(containerRequest.container_uuid).not.to.be.equal(''); + + cy.getContainer(activeUser.token, containerRequest.container_uuid) + .then(function(queuedContainer) { + expect(queuedContainer.state).to.be.equal('Queued'); + }); + cy.updateContainer(adminUser.token, containerRequest.container_uuid, { + state: 'Locked' + }).then(function(lockedContainer) { + expect(lockedContainer.state).to.be.equal('Locked'); + + cy.updateContainer(adminUser.token, lockedContainer.uuid, { + state: 'Running', + runtime_status: { + error: 'Something went wrong', + errorDetail: 'Process exited with status 1', + warning: 'Free disk space is low', + } + }) + .as('runningContainer') + .then(function(runningContainer) { + expect(runningContainer.state).to.be.equal('Running'); + expect(runningContainer.runtime_status).to.be.deep.equal({ + 'error': 'Something went wrong', + 'errorDetail': 'Process exited with status 1', + 'warning': 'Free disk space is low', + }); + }); + }) + }); + // Test that the UI shows the error and warning messages + cy.getAll('@containerRequest', '@runningContainer').then(function([containerRequest]) { + cy.loginAs(activeUser); + cy.goToPath(`/processes/${containerRequest.uuid}`); + cy.get('[data-cy=process-runtime-status-error]') + .should('contain', 'Something went wrong') + .and('contain', 'Process exited with status 1'); + cy.get('[data-cy=process-runtime-status-warning]') + .should('contain', 'Free disk space is low') + .and('contain', 'No additional warning details available'); + }); + + + // Force container_count for testing + let containerCount = 2; + cy.intercept({method: 'GET', url: '**/arvados/v1/container_requests/*'}, (req) => { + req.reply((res) => { + res.body.container_count = containerCount; + }); + }); + + cy.getAll('@containerRequest').then(function([containerRequest]) { + cy.goToPath(`/processes/${containerRequest.uuid}`); + cy.get('[data-cy=process-runtime-status-retry-warning]') + .should('contain', 'Process retried 1 time'); + }); + + cy.getAll('@containerRequest').then(function([containerRequest]) { + containerCount = 3; + cy.goToPath(`/processes/${containerRequest.uuid}`); + cy.get('[data-cy=process-runtime-status-retry-warning]') + .should('contain', 'Process retried 2 times'); + }); + }); +});