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

Write e2e tests for Compression #479

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bipuladh
Copy link
Contributor

Signed-off-by: Bipul Adhikari badhikar@redhat.com

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 10, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bipuladh

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

@bipuladh bipuladh changed the title [wip] Write e2e tests for Compression Write e2e tests for Compression Oct 10, 2022
@bipuladh bipuladh force-pushed the e2e-compression branch 2 times, most recently from c2fd79c to 84c4783 Compare October 10, 2022 13:43
Comment on lines 96 to 102
// wait for the pod CR to be registered
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2500);
cy.exec(
`oc wait --for=condition=ready pod -l "app=rook-ceph-tools" -n openshift-storage`
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we use "commandPoll" here with "oc get pod -l 'app=rook-ceph-tools' ..." ??
cy.wait can cause extra waiting (if pod gets created before 2500 ms) or can cause flake (if take more than 2500 ms)...
using "commandPoll" we do have more network calls, but IMO it is okay as we are not affecting performance of our product, just adding few more network calls in our CI...

Copy link
Collaborator

Choose a reason for hiding this comment

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

or if "commandPoll" won't work,
can we have some utility function similar to "commandPoll", which will continuously poll for a resource to check if it gets created or not instead of explicitly using cy.wait ??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are not waiting for pod to get created. we are waiting for the CR to get registered as mentioned in the comment.

Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't CR will get created if it is registered ?
so if CR exists it means it got created/registered...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a difference between a pod getting created which involves multiple steps such as container creation, image pulling, volume mounting etc. versus just creation of a pod CR. Currently the cy.wait is only to wait for the CR to be registered in the kube-apiserver once that does we are waiting using the oc wait command for the pod to actually come up(get ready); this approach is better than commandPoll as commandPoll continuously pings the api-server(similar to ddos attack) instead of that we are simply adding a watcher(internally supported by k8s) it will also not fail after 30 retries as compared to commandPoll.

Copy link
Collaborator

Choose a reason for hiding this comment

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

so what I meant was, check for CR created or not... status of CR can still be creating/running etc... anything...
if CR exists, it ensures that it is registered as well... so instead of cy.wait (and always waiting for 2500 ms for it to registered) we can use some function to do this job similar to "commandPoll" (not necessarily same function)... that will ensure that resource exists (not worry about status) before moving forwards will further...

Comment on lines 23 to 25
// Allow job CR to be registered
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2500);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we have some utility function like "commandPoll", which will continuously poll for a resource to check if it gets created or not instead of explicitly using cy.wait ??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned above we are not waiting for a resource to get created but for the CR to be registered. we could reduce it to 1000ms(1s) that should also work.

cy.byLegacyTestID('horizontal-link-Storage Systems').click();
cy.byTestID('horizontal-link-Storage Systems').click();
Copy link
Collaborator

Choose a reason for hiding this comment

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

on my local, I can still see attribute as "data-test-id" only. Same is true for other tests as well, they are using "byLegacyTestID", just confirming if it is intentional change or a miss ?

@@ -20,7 +20,7 @@ export const poolMessage: {

export const navigateToBlockPool = () => {
ODFCommon.visitStorageDashboard();
cy.byLegacyTestID('horizontal-link-Storage Systems').click();
cy.byTestID('horizontal-link-Storage Systems').click();
cy.byLegacyTestID('item-filter').type('ocs-storagecluster-storagesystem');
cy.byTestRows('resource-row').get('td a').first().click();
cy.byLegacyTestID('horizontal-link-BlockPools').click();
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is "data-test" instead...

@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

5 similar comments
@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

1 similar comment
@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

4 similar comments
@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

@bipuladh
Copy link
Contributor Author

bipuladh commented Dec 1, 2022

/test odf-console-e2e-aws

@bipuladh
Copy link
Contributor Author

bipuladh commented Dec 7, 2022

/test odf-console-e2e-aws

@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

@SanjalKatiyar
Copy link
Collaborator

/test odf-console-e2e-aws

1 similar comment
@bipuladh
Copy link
Contributor Author

/test odf-console-e2e-aws

@bipuladh
Copy link
Contributor Author

/retest all

Copy link
Contributor

openshift-ci bot commented Mar 19, 2024

@bipuladh: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test images
  • /test odf-console-e2e-aws

Use /test all to run all jobs.

In response to this:

/retest all

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@bipuladh
Copy link
Contributor Author

/test all

Signed-off-by: Bipul Adhikari <badhikar@redhat.com>
Copy link
Contributor

openshift-ci bot commented Apr 16, 2024

@bipuladh: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/odf-console-e2e-aws 45719de link true /test odf-console-e2e-aws

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants