X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/0d61292f1ce718f5cc252f45d6e220c70246c922..a5750c261be0991d8ebbe107115c9c5b01236f8d:/cypress/integration/process.spec.js diff --git a/cypress/integration/process.spec.js b/cypress/integration/process.spec.js index 75c318db..3234f7c4 100644 --- a/cypress/integration/process.spec.js +++ b/cypress/integration/process.spec.js @@ -191,4 +191,58 @@ describe('Process tests', function() { }); }); }); + + 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'); + }); + }); }); \ No newline at end of file