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

migrate e2e test for adding group permission #3683

Conversation

gitdallas
Copy link
Contributor

@gitdallas gitdallas commented Jan 24, 2025

closes: RHOAIENG-17420

Description

migrating test that user can add group as admin for project

How Has This Been Tested?

  • An oc login should be performed in the cluster before running the test
  • test-variables.yml should be configured properly
  • Export the path to the test-variables.yml: $ export CY_TEST_CONFIG=<path_to>/test-variables.yml
  • Locally against a PSI cluster and ODH-Nightly
image

How to run?
Go to odh-dashboard/frontend/src/tests/cypress and run the command npx cypress open . This will open the Cypress UI where testProjectAdminPermissions.cy.ts can be run.

Headless
Go to odh-dashboard/frontend/src/tests/cypress and run the command npx cypress run --spec "cypress/tests/e2e/dataScienceProjects/testProjectAdminPermissions.cy.ts" --browser chrome

or Execute 'npx cypress run --env grepTags=@ODS-2208'

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress This PR is in WIP state label Jan 24, 2025
@gitdallas gitdallas force-pushed the test/cypress-e2e-project-group-permissions branch 3 times, most recently from 61b2a57 to 706f3a0 Compare January 27, 2025 16:20
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.23%. Comparing base (d4b9a46) to head (ba541ed).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3683      +/-   ##
==========================================
- Coverage   84.23%   84.23%   -0.01%     
==========================================
  Files        1459     1459              
  Lines       33728    33728              
  Branches     9354     9354              
==========================================
- Hits        28412    28411       -1     
- Misses       5316     5317       +1     
Files with missing lines Coverage Δ
...ts/roleBinding/RoleBindingPermissionsNameInput.tsx 96.29% <ø> (ø)

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4b9a46...ba541ed. Read the comment docs.

@gitdallas gitdallas changed the title [WIP] migrate e2e test for adding group permission migrate e2e test for adding group permission Jan 27, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Jan 27, 2025
@gitdallas gitdallas requested review from mturley and ConorOM1 January 27, 2025 16:59
@ConorOM1
Copy link
Contributor

@gitdallas can you update the PR details to follow the same format as #3686 thank you !

@ConorOM1
Copy link
Contributor

/lgtm

Copy link
Contributor

@antowaddle antowaddle left a comment

Choose a reason for hiding this comment

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

@gitdallas Thanks for creating this test, really appreciated.

I've tried to execute this test against the latest Dashboard version, the test passed the first time but failed intermittently thereafter. Can you execute this test against the latest Dashboard code a few times and see if you see the same issue?
image

@openshift-ci openshift-ci bot removed the lgtm label Jan 29, 2025
@gitdallas gitdallas force-pushed the test/cypress-e2e-project-group-permissions branch from 706f3a0 to 224bc2e Compare January 29, 2025 14:47
@gitdallas
Copy link
Contributor Author

@antowaddle - it passed for me in CI, headless several times, and in the cypress browser several times.. but i noticed that it's not creating a dropdown menu for the name of the group, which it should... so changes are needed, and i may need some assistance figuring out the data here. maybe we can meet sometime tomorrow.

@antowaddle
Copy link
Contributor

@antowaddle - it passed for me in CI, headless several times, and in the cypress browser several times.. but i noticed that it's not creating a dropdown menu for the name of the group, which it should... so changes are needed, and i may need some assistance figuring out the data here. maybe we can meet sometime tomorrow.

@gitdallas Sure, no problem at all. Ping me when you are online and we can review.

@gitdallas gitdallas force-pushed the test/cypress-e2e-project-group-permissions branch 2 times, most recently from 06fdbc2 to 3d76561 Compare January 30, 2025 16:45
@gitdallas
Copy link
Contributor Author

@antowaddle - figured it out, but had to use some more complex selectors as we were missing a testid. i've added it so perhaps we can update it later and/or use for future tests.

@gitdallas gitdallas requested a review from antowaddle January 30, 2025 19:06
antowaddle

This comment was marked as outdated.

Copy link
Contributor

@antowaddle antowaddle left a comment

Choose a reason for hiding this comment

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

@gitdallas I pulled your branch, then launched the dashboard locally while connected to the e2e cluster. The test passes when launched locally via Cypress UI, but when I tried to launch it headlessly it fails.

Can you try please? npx cypress run --env grepTags=@ODS-2208 --browser chrome

I believe if we use multiple 'its' within a describe block, the tags in the tests should all be the same if projects are shared between the 'it' blocks.

@gitdallas gitdallas force-pushed the test/cypress-e2e-project-group-permissions branch from 3d76561 to edef947 Compare January 31, 2025 18:29
@gitdallas
Copy link
Contributor Author

@antowaddle - very odd this would work in one but not the other, i changed how the selection is made and it seems to work now in both ways.

@gitdallas gitdallas force-pushed the test/cypress-e2e-project-group-permissions branch from edef947 to efcc670 Compare January 31, 2025 19:42
@gitdallas gitdallas requested a review from antowaddle January 31, 2025 19:51
Signed-off-by: gitdallas <[email protected]>
@gitdallas gitdallas requested a review from antowaddle February 4, 2025 16:31
@antowaddle
Copy link
Contributor

Works fine now for me
image

@antowaddle
Copy link
Contributor

/lgtm /approved

@openshift-ci openshift-ci bot added the lgtm label Feb 4, 2025
@antowaddle
Copy link
Contributor

/approve

@gitdallas gitdallas requested a review from manosnoam February 4, 2025 17:18
Copy link
Contributor

@manosnoam manosnoam left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot removed the lgtm label Feb 5, 2025
@openshift-ci openshift-ci bot added the lgtm label Feb 5, 2025
Copy link
Contributor

openshift-ci bot commented Feb 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: antowaddle, manosnoam

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-ci openshift-ci bot added the approved label Feb 5, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 8450988 into opendatahub-io:main Feb 5, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants