[ARVADOS-WORKBENCH2] updated: 2.2.1-33-g8df73e82

Git user git at public.arvados.org
Thu Jul 15 01:24:05 UTC 2021


Summary of changes:
 cypress/integration/collection.spec.js           | 65 ++++++++++++++++++++++++
 src/common/config.ts                             |  2 +-
 src/components/checkbox-field/checkbox-field.tsx |  1 +
 tools/arvados_config.yml                         |  9 ++++
 4 files changed, 76 insertions(+), 1 deletion(-)

       via  8df73e82d637d7b2e81952fdc96a12a1011be99e (commit)
      from  e5dc88dd1a6c54610d92854d527e5048543d93ec (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 8df73e82d637d7b2e81952fdc96a12a1011be99e
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Wed Jul 14 22:23:24 2021 -0300

    17573: Adds integration tests for storage classes display & editing.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js
index f3b63218..308ce5f7 100644
--- a/cypress/integration/collection.spec.js
+++ b/cypress/integration/collection.spec.js
@@ -431,6 +431,71 @@ describe('Collection panel tests', function () {
             });
     });
 
+    it('views & edits storage classes data', function () {
+        const colName= `Test Collection ${Math.floor(Math.random() * 999999)}`;
+        cy.createCollection(adminUser.token, {
+            name: colName,
+            owner_uuid: activeUser.user.uuid,
+            manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:some-file\n",
+        }).as('collection').then(function () {
+            expect(this.collection.storage_classes_desired).to.deep.equal(['default'])
+
+            cy.loginAs(activeUser)
+            cy.goToPath(`/collections/${this.collection.uuid}`);
+
+            // Initial check: it should show the 'default' storage class
+            cy.get('[data-cy=collection-info-panel]')
+                .should('contain', 'Storage classes')
+                .and('contain', 'default')
+                .and('not.contain', 'foo')
+                .and('not.contain', 'bar');
+            // Edit collection: add storage class 'foo'
+            cy.get('[data-cy=collection-panel-options-btn]').click();
+            cy.get('[data-cy=context-menu]').contains('Edit collection').click();
+            cy.get('[data-cy=form-dialog]')
+                .should('contain', 'Edit Collection')
+                .and('contain', 'Storage classes')
+                .and('contain', 'default')
+                .and('contain', 'foo')
+                .and('contain', 'bar')
+                .within(() => {
+                    cy.get('[data-cy=checkbox-foo]').click();
+                });
+            cy.get('[data-cy=form-submit-btn]').click();
+            cy.get('[data-cy=collection-info-panel]')
+                .should('contain', 'default')
+                .and('contain', 'foo')
+                .and('not.contain', 'bar');
+            cy.doRequest('GET', `/arvados/v1/collections/${this.collection.uuid}`)
+                .its('body').as('updatedCollection')
+                .then(function () {
+                    expect(this.updatedCollection.storage_classes_desired).to.deep.equal(['default', 'foo']);
+                });
+            // Edit collection: remove storage class 'default'
+            cy.get('[data-cy=collection-panel-options-btn]').click();
+            cy.get('[data-cy=context-menu]').contains('Edit collection').click();
+            cy.get('[data-cy=form-dialog]')
+                .should('contain', 'Edit Collection')
+                .and('contain', 'Storage classes')
+                .and('contain', 'default')
+                .and('contain', 'foo')
+                .and('contain', 'bar')
+                .within(() => {
+                    cy.get('[data-cy=checkbox-default]').click();
+                });
+            cy.get('[data-cy=form-submit-btn]').click();
+            cy.get('[data-cy=collection-info-panel]')
+                .should('not.contain', 'default')
+                .and('contain', 'foo')
+                .and('not.contain', 'bar');
+            cy.doRequest('GET', `/arvados/v1/collections/${this.collection.uuid}`)
+                .its('body').as('updatedCollection')
+                .then(function () {
+                    expect(this.updatedCollection.storage_classes_desired).to.deep.equal(['foo']);
+                });
+        })
+    });
+
     it('uses the collection version browser to view a previous version', function () {
         const colName = `Test Collection ${Math.floor(Math.random() * 999999)}`;
 
diff --git a/src/common/config.ts b/src/common/config.ts
index 8a85ae00..7a98fd47 100644
--- a/src/common/config.ts
+++ b/src/common/config.ts
@@ -141,7 +141,7 @@ export const getStorageClasses = (config: Config): string[] => {
     const classes: Set<string> = new Set();
     const volumes = config.clusterConfig.Volumes;
     Object.keys(volumes).forEach(v => {
-        Object.keys(volumes[v].StorageClasses).forEach(sc => {
+        Object.keys(volumes[v].StorageClasses || {}).forEach(sc => {
             if (volumes[v].StorageClasses[sc]) {
                 classes.add(sc);
             }
diff --git a/src/components/checkbox-field/checkbox-field.tsx b/src/components/checkbox-field/checkbox-field.tsx
index bfa3714a..02a5e9a6 100644
--- a/src/components/checkbox-field/checkbox-field.tsx
+++ b/src/components/checkbox-field/checkbox-field.tsx
@@ -44,6 +44,7 @@ export const MultiCheckboxField = (props: WrappedFieldProps & MultiCheckboxField
             <FormControlLabel
                 control={
                     <Checkbox
+                        data-cy={`checkbox-${item}`}
                         key={idx}
                         name={`${props.input.name}[${idx}]`}
                         value={item}
diff --git a/tools/arvados_config.yml b/tools/arvados_config.yml
index a287fed4..963da48d 100644
--- a/tools/arvados_config.yml
+++ b/tools/arvados_config.yml
@@ -17,3 +17,12 @@ Clusters:
     Login:
       PAM:
         Enable: true
+    Volumes:
+      zzzzz-nyw5e-000000000000000:
+        StorageClasses:
+          default: true
+          foo: true
+      zzzzz-nyw5e-000000000000001:
+        StorageClasses:
+          default: true
+          bar: true

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list