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

e2e test that creates GKE cluster with default settings #12934

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

Conversation

IsaSih
Copy link
Contributor

@IsaSih IsaSih commented Dec 23, 2024

Summary

Occurred changes and/or fixed issues

This PR addresses the issue rancher/qa-tasks#1571.
This is a single e2e test that creates a GKE cluster with the default settings and verifies that the cluster is created and that the GKE default version and zone are displayed in the UI elements as expected. To support the test, were created GKE-related page objects for the GKE Create cloud credentials page, the GKE authenticate page with Project ID, and the Create GKE Cluster Page.

Some methods and variables were created but are not being used in this single test. Still, they will be used for the upcoming tests.

Storing the GKE Cloud credentials will be addressed in another PR.

Areas or cases that should be tested

Create a GKE Cluster with default settings
Other cluster provisioning-related tests
Other cloud credentials creation related tests
Other pages that contain LabeledInput or LabeledSelect elements

Areas which could experience regressions

other cluster provisioning tests

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@IsaSih IsaSih added this to the v2.11.0 milestone Dec 23, 2024
@IsaSih IsaSih requested a review from yonasberhe23 December 23, 2024 12:46
@IsaSih IsaSih self-assigned this Dec 23, 2024
@IsaSih IsaSih requested a review from richard-cox January 2, 2025 05:33
@IsaSih
Copy link
Contributor Author

IsaSih commented Jan 16, 2025

@richard-cox could you please give an update on the review? Thanks

richard-cox
richard-cox previously approved these changes Jan 17, 2025
let gkeVersion = '';
let clusterId = '';
let clusterDescription = '';
const gkeProjectId = JSON.parse(Cypress.env('gkeServiceAccount')).project_id;
Copy link
Member

Choose a reason for hiding this comment

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

I believe this is failing CI due to this line. We would need this new variable, GKE_SERVICE_ACCOUNT, present in the environment for it to work correctly. I'm not personally sure how to do it, but maybe @richard-cox or @izaac can instruct us?

Copy link
Member

Choose a reason for hiding this comment

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

error ref:

 1) An uncaught error was detected outside of a test:
     SyntaxError: The following error originated from your test code, not from Cypress.

  > "undefined" is not valid JSON

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.
      at JSON.parse (<anonymous>)
      at Suite.eval (webpack:///./cypress/e2e/tests/pages/manager/gke-cluster-provisioning.spec.ts:23:0)
      at describeGrep (webpack:///./node_modules/@cypress/grep/src/support.js:183:0)
      at ./cypress/e2e/tests/pages/manager/gke-cluster-provisioning.spec.ts (webpack:///./cypress/e2e/tests/pages/manager/gke-cluster-provisioning.spec.ts:15:0)
      at __webpack_require__ (webpack:///webpack/bootstrap:19:0)
      at 0 (https://127.0.0.1/__cypress/tests?p=cypress/e2e/tests/pages/manager/gke-cluster-provisioning.spec.ts:8117:18)
      at __webpack_require__ (webpack:///webpack/bootstrap:19:0)
      at eval (webpack:///webpack/bootstrap:83:0)
      at eval (https://127.0.0.1/__cypress/tests?p=cypress/e2e/tests/pages/manager/gke-cluster-provisioning.spec.ts:87:10)
      at eval (<anonymous>)

Copy link
Contributor

@izaac izaac Jan 28, 2025

Choose a reason for hiding this comment

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

I wasn't expecting this to run in Github Actions with the @jenkins tag. Only on Jenkins.

Edit: I am not sure how the grepTags change the behavior of Cypress' describe and it blocks internally but I guess the code gets interpreted before the tag logic is applied.

I see other filtered specs still selected but then the greptags logic blocks the test from execution.

Catching the undefined might shed some light to my theory.

Copy link
Contributor

@izaac izaac Jan 28, 2025

Choose a reason for hiding this comment

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

In the meantime we should catch the undefined value before attempting to parse the variable.

Copy link
Contributor

Choose a reason for hiding this comment

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

it seems like it's only an issue with @standardUser tag. we can remove that tag to get unblocked and create a separate issue to investigate this

Copy link
Contributor

@yonasberhe23 yonasberhe23 Jan 29, 2025

Choose a reason for hiding this comment

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

scratch that idea, it didn't work (test is still picked up when @standardUser tag removed). We should handle undefined or null values using try catch as Izaac suggested. Sent Isabela some pointers

Copy link
Contributor

Choose a reason for hiding this comment

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

I've created an issue to investigate the problem we're seeing with the grep tags rancher/qa-tasks#1663

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.

[UI] Cluster Provisioning - Provision Hosted Cluster - GKE
5 participants