Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cypress integration test support for Ceph plugin #7165

Merged
merged 1 commit into from Nov 11, 2020

Conversation

bipuladh
Copy link
Contributor

@bipuladh bipuladh commented Nov 9, 2020

Add test for Subscription flow for OCS Operator
Screenshot from 2020-11-10 03-33-53

@openshift-ci-robot openshift-ci-robot added the component/ceph Related to ceph-storage-plugin label Nov 9, 2020
@openshift-ci-robot openshift-ci-robot added component/core Related to console core functionality component/olm Related to OLM labels Nov 9, 2020
@bipuladh
Copy link
Contributor Author

bipuladh commented Nov 9, 2020

/assign @dtaylor113 @spadgett

@bipuladh
Copy link
Contributor Author

/retest

Copy link
Contributor

@dtaylor113 dtaylor113 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, looks great, just a couple of concerns:

  • Please update test-cypress.sh script to include ceph
  • Please add afterEach hook
  • Please investigate and try to avoid using .click({ force: true })
    Thanks

@@ -0,0 +1 @@
export const installSucess = 'svg[fill="#3e8635"]';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little vauge? Is there an ID we can use, or as a fall back, a css selector?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A css selector is there but we will need that color code to verify that it''s green we could use .co-operator-install-page__pkg-indicator > :nth-child(2) > svg[fill="#3e8635"].

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be validating specific colors. We should have data attributes for success/error icons and check for those.

frontend/package.json Show resolved Hide resolved
Copy link
Contributor

@dtaylor113 dtaylor113 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, per Cypress Best Practices, each it(...) test should be independant and not rely on state of previous tests. Please refactor/group dependent tests together.
You might end up having only have a single it(..) test, and you can add cy.log(...) for each of the previous it(..) descriptions.

Copy link
Contributor

@dtaylor113 dtaylor113 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm -thanks!

@@ -0,0 +1 @@
export const installSucess = 'svg[fill="#3e8635"]';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be validating specific colors. We should have data attributes for success/error icons and check for those.

@@ -1,3 +1,4 @@
export const submitButton = 'button[type=submit]';
export const errorMessage = '.pf-c-alert.pf-m-inline.pf-m-danger';
export const successMessage = '.pf-c-alert.pf-m-inline.pf-m-success';
export const primaryButton = '.pf-c-button.pf-m-primary';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to have a data-test attribute if possible.

cy.get(installSucess, { timeout: 180000 }).should('be.visible');
cy.exec('oc get project openshift-storage -o yaml')
.its('stdout')
.should('contain', 'openshift.io/cluster-monitoring: "true"');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do a substring match. Parse the JSON and check for the specific annotation.

Comment on lines 33 to 43
cy.exec('oc get po -n openshift-storage')
.its('stdout')
.should('contain', 'noobaa-operator')
.should('contain', 'ocs-operator')
.should('contain', 'rook-ceph-operator');
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here. We shouldn't be using substring matches on CLI output. Better to get the JSON and parse it.

Copy link
Contributor

@dtaylor113 dtaylor113 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some concerns.

The contents of .../artifacts/e2e-gcp-console/ seems to be:

 gather-audit-logs/
 gather-extra/
 gather-must-gather/
 ipi-conf-gcp/
 ipi-conf/
 ipi-deprovision-deprovision/
 ipi-install-install/
 ipi-install-rbac/
 test/

Whereas I'm used to seeing in .../artifacts/e2e-gcp-console/

 container-logs/
 gui_test_screenshots/
 installer/
 junit/
 metrics/
 network/
 nodes/
 pods/
...

Is this expected because running from ceph-plugin?

Also, there are some weird characters in the Cypress log output in /artifacts/e2e-gcp-console/test/container-logs/test.log:

�[90m====================================================================================================�[39m

�[0m  (�[4m�[1mRun Starting�[22m�[24m)�[0m

�[90m  ┌�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m┐�[39m
�[90m  │�[39m �[90mCypress:�[39m    5.0.0                                                                              �[90m│�[39m
�[90m  │�[39m �[90mBrowser:�[39m    Chrome 84 �[90m(headless)�[39m                                                               �[90m│�[39m
�[90m  │�[39m �[90mSpecs:�[39m      �[0m8 found (app/auth-multiuser-login.spec.ts, crud/k8-openshift-cruds.spec.ts, crud/n�[0m �[90m│�[39m
�[90m  │�[39m             �[0mamespace-crud.spec.ts, crud/other-routes.spec.ts, i18n/pseudolocalization.spec.ts,�[0m �[90m│�[39m
�[90m  │�[39m             �[0m monitoring/monitoring.spec.ts, storage/clone.spec.ts, storage/snapshot.spec.ts)�[0m   �[90m│�[39m
�[90m  └�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m─�[39m�[90m┘�[39m

whereas in /artifacts/e2e-gcp-console/container-logs/test.log it disaplays as:

================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    5.0.0                                                                              │
  │ Browser:    Chrome 84 (headless)                                                               │
  │ Specs:      8 found (app/auth-multiuser-login.spec.ts, crud/k8-openshift-cruds.spec.ts, crud/n │
  │             amespace-crud.spec.ts, crud/other-routes.spec.ts, i18n/pseudolocalization.spec.ts, │
  │              monitoring/monitoring.spec.ts, storage/clone.spec.ts, storage/snapshot.spec.ts)   │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

test-log in ceph-plugins is located at
/artifacts/e2e-gcp-console/test/container-logs/test.log
whereas elsewhere it is located at
/artifacts/e2e-gcp-console/container-logs/test.log

Just want to make sure these issues/concerns are raised and known.
I'm ok if directory differences are expected, but we do need to fix the character issues because if this PR is merged it looks like it'll mess up the test.log file!

@bipuladh
Copy link
Contributor Author

@dtaylor113 ceph tests would not cause the artifacts to change. The other thing related to cypress test should be something else as these tests are not triggered at all.
I can see these issues you have mentioned in unrelated PRs as well.
FYI https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openshift_console/7182/pull-ci-openshift-console-master-e2e-gcp-console/1326555242052980736/artifacts/e2e-gcp-console/test/container-logs/test.log

Add test for Subscription flow for OCS Operator
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Adding my approval. I'll let @dtaylor113 give the final lgtm

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 11, 2020
@dtaylor113
Copy link
Contributor

/retest

Copy link
Contributor

@dtaylor113 dtaylor113 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
Remaining Cypress issues not related to this PR

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 11, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bipuladh, dtaylor113, spadgett

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 026f43a into openshift:master Nov 11, 2020
@spadgett spadgett added this to the v4.7 milestone Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/ceph Related to ceph-storage-plugin component/core Related to console core functionality component/olm Related to OLM component/shared Related to console-shared lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants