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

Cypress e2e Project Creation/Deletion #3388

Merged

Conversation

antowaddle
Copy link
Contributor

@antowaddle antowaddle commented Oct 25, 2024

https://issues.redhat.com/browse/RHOAIENG-14367

Description

Migration of the below Robot test to Cypress

ODS-1775

https://opendatascience-jenkins-csb-rhods.apps.ocp-c1.prod.psi.redhat.com/job/rhoai/job/2.13/job/selfmanaged/job/cli/job/aws/job/rhoai-smoke/1/robot/report/log.html#s1-s4-s2-s4-s1-t3 

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

How to run

After exporting the test-variables.yml we have 2 different ways:

Using the UI
Go to odh-dashboard/frontend/src/tests/cypress and run the command npx cypress open . This will open the Cypress UI where verifyDSPCreation.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/testProjectCreation.cy.ts" --browser chrome

How Has This Been Tested?

Locally, against a live cluster.
image

Test Impact

This is already a test

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

This PR also introduces a plugin - https://github.com/filiphric/cypress-plugin-steps This plugin will display text contained within cy.step('...') numbered and highlighted on the Cypress Console to allow for improved test bugging, maintainability and readability.
image

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@antowaddle antowaddle changed the title Cypress e2e Project Creation/Deletion [NOT READY FOR REVIEW]Cypress e2e Project Creation/Deletion Oct 25, 2024
@antowaddle antowaddle changed the title [NOT READY FOR REVIEW]Cypress e2e Project Creation/Deletion Cypress e2e Project Creation/Deletion Oct 25, 2024
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.87%. Comparing base (538a8ff) to head (5c2f26e).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3388      +/-   ##
==========================================
- Coverage   85.89%   85.87%   -0.02%     
==========================================
  Files        1338     1338              
  Lines       30127    30127              
  Branches     8274     8274              
==========================================
- Hits        25877    25872       -5     
- Misses       4250     4255       +5     

see 5 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 538a8ff...5c2f26e. Read the comment docs.

@antowaddle antowaddle requested a review from FedeAlonso October 29, 2024 15:02
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.

Thanks @antowaddle for your first PR!
See some suggestions I have.

@antowaddle antowaddle force-pushed the cypress-RHOAIENG-14367 branch from cf178b4 to 113d069 Compare October 31, 2024 09:58
Copy link
Contributor

@FedeAlonso FedeAlonso 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 added the lgtm label Oct 31, 2024
@openshift-ci openshift-ci bot removed the lgtm label Oct 31, 2024
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.

Looks good, thanks!

@openshift-ci openshift-ci bot added the lgtm label Oct 31, 2024
Copy link
Contributor

openshift-ci bot commented Oct 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeAlonso, 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-merge-bot openshift-merge-bot bot merged commit a4ba326 into opendatahub-io:main Oct 31, 2024
6 checks passed
Comment on lines +67 to +68
// Verify project creation
cy.step(`Verify that the project ${testData.dsProjectName} has been created`);
Copy link
Member

Choose a reason for hiding this comment

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

Is it normal practice to always have a comment and then a cy.step("") with a string that says the same thing as the comment? Or is it just because the test was written without cy.step initially and the comments are leftovers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've intentionally left comments also, in some more intricate tests we may also want to add comments but not necessarily print that information to the console in cy.step.

@antowaddle antowaddle deleted the cypress-RHOAIENG-14367 branch December 20, 2024 11:47
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