});
});
- it('shows workflow details', function() {
+ it('should handle malformed run', function() {
cy.createResource(activeUser.token, "workflows", {workflow: {
name: "Test wf",
definition: JSON.stringify({
$graph: [
{
"class": "Workflow",
- "hints": [
- {
- "class": "DockerRequirement",
- "dockerPull": "python:2-slim"
- }
- ],
"id": "#main",
- "inputs": [
- {
- "id": "#main/file1",
- "type": "File"
- },
- {
- "id": "#main/numbering",
- "type": [
- "null",
- "boolean"
- ]
- },
- {
- "default": {
- "basename": "args.py",
- "class": "File",
- "location": "keep:de738550734533c5027997c87dc5488e+53/args.py",
- "nameext": ".py",
- "nameroot": "args",
- "size": 179
- },
- "id": "#main/args.py",
- "type": "File"
- }
- ],
- "outputs": [
- {
- "id": "#main/args",
- "outputSource": "#main/step/args",
- "type": {
- "items": "string",
- "name": "_:b0adccc1-502d-476f-8a5b-c8ef7119e2dc",
- "type": "array"
- }
- }
- ],
+ "inputs": [],
+ "outputs": [],
"requirements": [
{
"class": "SubworkflowFeatureRequirement"
"steps": [
{
"id": "#main/cat1-testcli.cwl (v1.2.0-109-g9b091ed)",
- "in": [
- {
- "id": "#main/step/file1",
- "source": "#main/file1"
- },
- {
- "id": "#main/step/numbering",
- "source": "#main/numbering"
- },
- {
- "id": "#main/step/args.py",
- "source": "#main/args.py"
- }
- ],
+ "in": [],
"label": "cat1-testcli.cwl (v1.2.0-109-g9b091ed)",
"out": [
{
"id": "#main/step/args"
}
],
- "run": "keep:6b2f3b54194acf69476f22ae52c8ceaf+62/cat1-testcli.cwl"
+ "run": `keep:undefined/bar`
}
]
}
"http://arvados.org/cwl#gitPath": "tests/cat1-testcli.cwl",
"http://arvados.org/cwl#gitStatus": ""
})
- }}).then(function() {
- cy.createCollection(adminUser.token, {
- name: `Test collection ${Math.floor(Math.random() * 999999)}`,
- owner_uuid: activeUser.user.uuid,
- manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
- })
+ }}).then(function(workflowResource) {
+ cy.loginAs(activeUser);
+ cy.goToPath(`/workflows/${workflowResource.uuid}`);
+ cy.get('[data-cy=registered-workflow-info-panel]').should('contain', workflowResource.name);
+ cy.get('[data-cy=workflow-details-attributes-modifiedby-user]').contains(`Active User (${activeUser.user.uuid})`);
+ });
+ });
+
+ const verifyIOParameter = (name, label, doc, val, collection) => {
+ cy.get('table tr').contains(name).parents('tr').within(($mainRow) => {
+ label && cy.contains(label);
+
+ if (val) {
+ if (Array.isArray(val)) {
+ val.forEach(v => cy.contains(v));
+ } else {
+ cy.contains(val);
+ }
+ }
+ if (collection) {
+ cy.contains(collection);
+ }
+ });
+ };
+
+ it('shows workflow details', function() {
+ cy.createCollection(adminUser.token, {
+ name: `Test collection ${Math.floor(Math.random() * 999999)}`,
+ owner_uuid: activeUser.user.uuid,
+ manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
})
- .then(function(workflowResource) {
- cy.loginAs(activeUser);
- cy.goToPath(`/workflows/${workflowResource.uuid}`);
- cy.get('[data-cy=registered-workflow-info-panel]').should('contain', workflowResource.name);
- cy.get('[data-cy=workflow-details-attributes-modifiedby-user]').contains(`Active User (${activeUser.user.uuid})`);
+ .then(function(collectionResource) {
+ cy.createResource(activeUser.token, "workflows", {workflow: {
+ name: "Test wf",
+ definition: JSON.stringify({
+ cwlVersion: "v1.2",
+ $graph: [
+ {
+ "class": "Workflow",
+ "hints": [
+ {
+ "class": "DockerRequirement",
+ "dockerPull": "python:2-slim"
+ }
+ ],
+ "id": "#main",
+ "inputs": [
+ {
+ "id": "#main/file1",
+ "type": "File"
+ },
+ {
+ "id": "#main/numbering",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ },
+ {
+ "default": {
+ "basename": "args.py",
+ "class": "File",
+ "location": "keep:de738550734533c5027997c87dc5488e+53/args.py",
+ "nameext": ".py",
+ "nameroot": "args",
+ "size": 179
+ },
+ "id": "#main/args.py",
+ "type": "File"
+ }
+ ],
+ "outputs": [
+ {
+ "id": "#main/args",
+ "outputSource": "#main/step/args",
+ "type": {
+ "items": "string",
+ "name": "_:b0adccc1-502d-476f-8a5b-c8ef7119e2dc",
+ "type": "array"
+ }
+ }
+ ],
+ "requirements": [
+ {
+ "class": "SubworkflowFeatureRequirement"
+ }
+ ],
+ "steps": [
+ {
+ "id": "#main/cat1-testcli.cwl (v1.2.0-109-g9b091ed)",
+ "in": [
+ {
+ "id": "#main/step/file1",
+ "source": "#main/file1"
+ },
+ {
+ "id": "#main/step/numbering",
+ "source": "#main/numbering"
+ },
+ {
+ "id": "#main/step/args.py",
+ "source": "#main/args.py"
+ }
+ ],
+ "label": "cat1-testcli.cwl (v1.2.0-109-g9b091ed)",
+ "out": [
+ {
+ "id": "#main/step/args"
+ }
+ ],
+ "run": `keep:${collectionResource.portable_data_hash}/bar`
+ }
+ ]
+ }
+ ],
+ "cwlVersion": "v1.2",
+ "http://arvados.org/cwl#gitBranch": "1.2.1_proposed",
+ "http://arvados.org/cwl#gitCommit": "9b091ed7e0bef98b3312e9478c52b89ba25792de",
+ "http://arvados.org/cwl#gitCommitter": "GitHub <noreply@github.com>",
+ "http://arvados.org/cwl#gitDate": "Sun, 11 Sep 2022 21:24:42 +0200",
+ "http://arvados.org/cwl#gitDescribe": "v1.2.0-109-g9b091ed",
+ "http://arvados.org/cwl#gitOrigin": "git@github.com:common-workflow-language/cwl-v1.2",
+ "http://arvados.org/cwl#gitPath": "tests/cat1-testcli.cwl",
+ "http://arvados.org/cwl#gitStatus": ""
+ })
+ }}).then(function(workflowResource) {
+ cy.loginAs(activeUser);
+ cy.goToPath(`/workflows/${workflowResource.uuid}`);
+ cy.get('[data-cy=registered-workflow-info-panel]').should('contain', workflowResource.name);
+ cy.get('[data-cy=workflow-details-attributes-modifiedby-user]').contains(`Active User (${activeUser.user.uuid})`);
+ cy.get('[data-cy=registered-workflow-info-panel')
+ .should('contain', 'gitCommit: 9b091ed7e0bef98b3312e9478c52b89ba25792de')
+
+ cy.get('[data-cy=process-io-card] h6').contains('Inputs')
+ .parents('[data-cy=process-io-card]').within(() => {
+ verifyIOParameter('file1', null, '', '', '');
+ verifyIOParameter('numbering', null, '', '', '');
+ verifyIOParameter('args.py', null, '', 'args.py', 'de738550734533c5027997c87dc5488e+53');
+ });
+ cy.get('[data-cy=process-io-card] h6').contains('Outputs')
+ .parents('[data-cy=process-io-card]').within(() => {
+ verifyIOParameter('args', null, '', '', '');
+ });
+ cy.get('[data-cy=collection-files-panel]').within(() => {
+ cy.get('[data-cy=collection-files-right-panel]', { timeout: 5000 })
+ .should('contain', 'bar');
+ });
+ });
});
});
});