[arvados-workbench2] updated: 2.5.0-54-gf0b5bf0e

git repository hosting git at public.arvados.org
Fri Feb 24 22:23:23 UTC 2023


Summary of changes:
 cypress/integration/workflow.spec.js               | 154 +++++++++++++++++++++
 .../details-panel/workflow-details.tsx             |  50 +++----
 src/views/process-panel/process-details-card.tsx   |   2 +-
 3 files changed, 181 insertions(+), 25 deletions(-)
 create mode 100644 cypress/integration/workflow.spec.js

       via  f0b5bf0ef88fdd06e96cf0c685ab49c2ea4ec035 (commit)
      from  0c37a7e69b11fb23a4ffa2902a1343b3cd6769bc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit f0b5bf0ef88fdd06e96cf0c685ab49c2ea4ec035
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Feb 24 17:22:52 2023 -0500

    19482: Cypress tests WIP
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/cypress/integration/workflow.spec.js b/cypress/integration/workflow.spec.js
new file mode 100644
index 00000000..3315284c
--- /dev/null
+++ b/cypress/integration/workflow.spec.js
@@ -0,0 +1,154 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+describe('Registered workflow panel tests', function() {
+    let activeUser;
+    let adminUser;
+
+    before(function() {
+        // Only set up common users once. These aren't set up as aliases because
+        // aliases are cleaned up after every test. Also it doesn't make sense
+        // to set the same users on beforeEach() over and over again, so we
+        // separate a little from Cypress' 'Best Practices' here.
+        cy.getUser('admin', 'Admin', 'User', true, true)
+            .as('adminUser').then(function() {
+                adminUser = this.adminUser;
+            }
+        );
+        cy.getUser('user', 'Active', 'User', false, true)
+            .as('activeUser').then(function() {
+                activeUser = this.activeUser;
+            }
+        );
+    });
+
+    it('should handle null definition', function() {
+        cy.createResource(activeUser.token, "workflows", {workflow: {name: "Test wf"}})
+            .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})`);
+            });
+    });
+
+    it('should handle malformed definition', function() {
+        cy.createResource(activeUser.token, "workflows", {workflow: {name: "Test wf", definition: "zap:"}})
+            .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})`);
+            });
+    });
+
+    it('shows workflow details', function() {
+        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:6b2f3b54194acf69476f22ae52c8ceaf+62/cat1-testcli.cwl"
+                            }
+                        ]
+                    }
+                ],
+                "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 at 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 at github.com:common-workflow-language/cwl-v1.2",
+                "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})`);
+            });
+    });
+});
diff --git a/src/views-components/details-panel/workflow-details.tsx b/src/views-components/details-panel/workflow-details.tsx
index cb5e6a66..d9575cd8 100644
--- a/src/views-components/details-panel/workflow-details.tsx
+++ b/src/views-components/details-panel/workflow-details.tsx
@@ -77,32 +77,34 @@ export const getRegisteredWorkflowPanelData = (item: WorkflowResource, auth: Aut
     // parse definition
     const wfdef = parseWorkflowDefinition(item);
 
-    const inputs = getWorkflowInputs(wfdef);
-    if (inputs) {
-        inputs.forEach(elm => {
-            if (elm.default !== undefined && elm.default !== null) {
-                elm.value = elm.default;
-            }
-        });
-        inputParams = formatInputData(inputs, auth);
-    }
+    if (wfdef) {
+        const inputs = getWorkflowInputs(wfdef);
+        if (inputs) {
+            inputs.forEach(elm => {
+                if (elm.default !== undefined && elm.default !== null) {
+                    elm.value = elm.default;
+                }
+            });
+            inputParams = formatInputData(inputs, auth);
+        }
 
-    const outputs = getWorkflowOutputs(wfdef);
-    if (outputs) {
-        outputParams = formatOutputData(outputs, {}, undefined, auth);
-    }
+        const outputs = getWorkflowOutputs(wfdef);
+        if (outputs) {
+            outputParams = formatOutputData(outputs, {}, undefined, auth);
+        }
 
-    const wf = getWorkflow(wfdef);
-    if (wf) {
-        const REGEX = /keep:([0-9a-f]{32}\+\d+)\/.*/;
-        if (wf["steps"]) {
-            workflowCollection = wf["steps"][0].run.match(REGEX)[1];
+        const wf = getWorkflow(wfdef);
+        if (wf) {
+            const REGEX = /keep:([0-9a-f]{32}\+\d+)\/.*/;
+            if (wf["steps"]) {
+                workflowCollection = wf["steps"][0].run.match(REGEX)[1];
+            }
         }
-    }
 
-    for (const elm in wfdef) {
-        if (elm.startsWith("http://arvados.org/cwl#git")) {
-            gitprops[elm.substr(23)] = wfdef[elm]
+        for (const elm in wfdef) {
+            if (elm.startsWith("http://arvados.org/cwl#git")) {
+                gitprops[elm.substr(23)] = wfdef[elm]
+            }
         }
     }
 
@@ -123,7 +125,7 @@ export const WorkflowDetailsAttributes = connect(mapStateToProps, mapDispatchToP
             const data = getRegisteredWorkflowPanelData(workflow, auth);
             return <Grid container>
                 <Button onClick={workflow && onClick(workflow)} className={classes.runButton} variant='contained'
-                    data-cy='details-panel-run-btn' color='primary' size='small'>
+                    data-cy='workflow-details-panel-run-btn' color='primary' size='small'>
                     <StartIcon />
                     Run Process
                 </Button>
@@ -143,7 +145,7 @@ export const WorkflowDetailsAttributes = connect(mapStateToProps, mapDispatchToP
                 <Grid item xs={12}>
                     <DetailsAttribute label='Last modified' value={formatDate(workflow?.modifiedAt)} />
                 </Grid>
-                <Grid item xs={12} >
+                <Grid item xs={12} data-cy="workflow-details-attributes-modifiedby-user">
                     <DetailsAttribute
                         label='Last modified by user' linkToUuid={workflow?.modifiedByUserUuid}
                         uuidEnhancer={(uuid: string) => <ResourceWithName uuid={uuid} />} />
diff --git a/src/views/process-panel/process-details-card.tsx b/src/views/process-panel/process-details-card.tsx
index 2e5f40b5..13e82397 100644
--- a/src/views/process-panel/process-details-card.tsx
+++ b/src/views/process-panel/process-details-card.tsx
@@ -114,7 +114,7 @@ export const ProcessDetailsCard = withStyles(styles)(
                                 className={classes.runButton}
                                 onClick={() => startProcess(process.containerRequest.uuid)}>
                                 <StartIcon />
-                                Run Workflow
+                                Run Process
                             </Button>}
                         {process.container && process.container.state === ContainerState.RUNNING &&
                             <span className={classes.cancelButton} onClick={() => cancelProcess(process.containerRequest.uuid)}>Cancel</span>}

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list