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

test: [M3-6620] - Add assertions for created LKE cluster in Cypress LKE tests #10593

Merged
merged 4 commits into from
Jul 2, 2024

Conversation

AzureLatte
Copy link
Contributor

@AzureLatte AzureLatte commented Jun 18, 2024

Description 📝

Assertions should be added to the LKE creation e2e test to confirm that the correct information is shown

Changes 🔄

  • Add assertions for created LKE cluster in Cypress LKE tests

How to test 🧪

yarn cy:run -s "cypress/e2e/core/kubernetes/lke-create.spec.ts"

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@AzureLatte AzureLatte self-assigned this Jun 18, 2024
@AzureLatte AzureLatte requested a review from a team as a code owner June 18, 2024 18:51
@AzureLatte AzureLatte requested review from jdamore-linode and removed request for a team June 18, 2024 18:51
@AzureLatte AzureLatte requested a review from a team as a code owner June 18, 2024 18:51
@AzureLatte AzureLatte requested review from dwiley-akamai and cpathipa and removed request for a team June 18, 2024 18:51
Copy link

github-actions bot commented Jun 18, 2024

Coverage Report:
Base Coverage: 83.09%
Current Coverage: 83.09%

Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

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

Confirmed the test passes remotely ✅

(I did observe a failure locally)

Screenshot 2024-06-18 at 5 18 48 PM

Comment on lines 118 to 121
let totalcpu = 0;
let totalmemory = 0;
let totalstorage = 0;
let monthprice = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's camel case these to be consistent with how we typically handle variable names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! I will update them

Comment on lines 161 to 178
if (clusterPlan.size == 2 && clusterPlan.type == 'Linode') {
totalcpu = totalcpu + nodeCount * 1;
totalmemory = totalmemory + nodeCount * 2;
totalstorage = totalstorage + nodeCount * 50;
monthprice = monthprice + nodeCount * 12;
}
if (clusterPlan.size == 4 && clusterPlan.type == 'Linode') {
totalcpu = totalcpu + nodeCount * 2;
totalmemory = totalmemory + nodeCount * 4;
totalstorage = totalstorage + nodeCount * 80;
monthprice = monthprice + nodeCount * 24;
}
if (clusterPlan.size == 4 && clusterPlan.type == 'Dedicated') {
totalcpu = totalcpu + nodeCount * 2;
totalmemory = totalmemory + nodeCount * 4;
totalstorage = totalstorage + nodeCount * 80;
monthprice = monthprice + nodeCount * 36;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

On first glance I found these a bit unclear. The four variables are initialized to 0 and don't get modified anywhere else, right? Couldn't we just do, for example, totalStorage = nodeCount * 50?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for the scenario when different linodes selected, the values can be calculated as a total. For example, when both clusterPlan.size == 2 && clusterPlan.type == 'Linode' and clusterPlan.size == 4 && clusterPlan.type == 'Dedicated' picked, the four variables need to be added based on the previous sum.

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Ready for Review labels Jun 27, 2024
@AzureLatte AzureLatte merged commit 98ccce7 into linode:develop Jul 2, 2024
18 checks passed
@AzureLatte AzureLatte deleted the M3-6620 branch July 2, 2024 16:37
nikhagra-akamai pushed a commit to nikhagra-akamai/manager that referenced this pull request Jul 3, 2024
…KE tests (linode#10593)

* Add assertions for lke tests

* update comments

* Added changeset: Add assertions for created LKE cluster in Cypress LKE tests

* update after reviews
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants