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
Conversation
/assign @dtaylor113 @spadgett |
/retest |
There was a problem hiding this 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 includeceph
- Please add
afterEach
hook - Please investigate and try to avoid using
.click({ force: true })
Thanks
frontend/packages/ceph-storage-plugin/integration-tests-cypress/tests/subscribe-to-ocs.spec.ts
Show resolved
Hide resolved
@@ -0,0 +1 @@ | |||
export const installSucess = 'svg[fill="#3e8635"]'; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
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/packages/ceph-storage-plugin/integration-tests-cypress/tests/subscribe-to-ocs.spec.ts
Show resolved
Hide resolved
7d03d01
to
330af0d
Compare
There was a problem hiding this 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.
330af0d
to
d7ce3e8
Compare
There was a problem hiding this 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"]'; |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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"'); |
There was a problem hiding this comment.
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.
cy.exec('oc get po -n openshift-storage') | ||
.its('stdout') | ||
.should('contain', 'noobaa-operator') | ||
.should('contain', 'ocs-operator') | ||
.should('contain', 'rook-ceph-operator'); | ||
}); |
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
@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. |
d7ce3e8
to
f1ce766
Compare
Add test for Subscription flow for OCS Operator
f1ce766
to
fbc326d
Compare
There was a problem hiding this 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
/retest |
There was a problem hiding this 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
[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 |
Add test for Subscription flow for OCS Operator