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

tests: [M3-8656] - Mock LKE creation flow + APL coverage #11347

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Dec 2, 2024

Description 📝

PR to remove any "real" entity creation during the create cluster flow and add APL coverage to the create specs.

Note

The reason for mocking the main create flow is to avoid creating real clusters in the CI for security reasons.

Changes 🔄

  • Change main create flow to use mocks
  • Support LKE creation with APL

How to test 🧪

Prerequisites

Verification steps

  • Run code locally + yarn cy:debug > select lke-create
  • Confirm all other LKE suites are running fine in the CI

As an Author, to speed up the review process, I considered 🤔

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@abailly-akamai abailly-akamai self-assigned this Dec 2, 2024
@abailly-akamai abailly-akamai added LKE Related to Linode Kubernetes Engine offerings APL labels Dec 2, 2024
@abailly-akamai abailly-akamai changed the title [M3-8656] - Mock LKE tests + APL integration test: [M3-8656] - Mock LKE tests + APL integration Dec 2, 2024
@abailly-akamai abailly-akamai added Testing e2e Indicates that a PR touches Cypress tests in some way labels Dec 2, 2024
ended?: string;
description?: string;
ended?: string | null;
description?: string | null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just noticed this when inspecting response. I don't think we need a changeset?

Copy link
Member

Choose a reason for hiding this comment

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

Could be "fixed" but okay without one too

@abailly-akamai abailly-akamai marked this pull request as ready for review December 2, 2024 20:05
@abailly-akamai abailly-akamai requested review from a team as code owners December 2, 2024 20:05
@abailly-akamai abailly-akamai requested review from cliu-akamai, dwiley-akamai, hkhalil-akamai and jdamore-linode and removed request for a team December 2, 2024 20:05
@abailly-akamai abailly-akamai changed the title test: [M3-8656] - Mock LKE tests + APL integration tests: [M3-8656] - Mock LKE tests + APL integration Dec 2, 2024
@abailly-akamai abailly-akamai changed the title tests: [M3-8656] - Mock LKE tests + APL integration tests: [M3-8656] - Mock LKE creation flow + APL coverage Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

Coverage Report:
Base Coverage: 86.95%
Current Coverage: 86.95%

@mjac0bs
Copy link
Contributor

mjac0bs commented Dec 2, 2024

👋🏼 Just created some merge conflicts here in the lke-create spec by merging in #11322. Hopefully they're easy to resolve - LKE-E test coverage is minimal and will be built out as we continue. Thanks for the clean up in this file; will follow suit going forward.

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🎉 463 passing tests on test run #5 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing463 Passing2 Skipped99m 1s

ended?: string;
description?: string;
ended?: string | null;
description?: string | null;
Copy link
Member

Choose a reason for hiding this comment

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

Could be "fixed" but okay without one too

Comment on lines +607 to +608
ended?: string | null;
description?: string | null;
Copy link
Member

Choose a reason for hiding this comment

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

Should the ?s be removed? I think ended and description will always be in the response

Suggested change
ended?: string | null;
description?: string | null;
ended: string | null;
description: string | null;

Comment on lines +241 to +247
cy.wait('@createCluster');
cy.wait('@getCluster');
cy.wait('@getClusterPools');
cy.wait('@getDashboardUrl');
cy.wait('@getControlPlaneACL');
cy.wait('@getApiEndpoints');
cy.wait('@getLinodeTypes');
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
cy.wait('@createCluster');
cy.wait('@getCluster');
cy.wait('@getClusterPools');
cy.wait('@getDashboardUrl');
cy.wait('@getControlPlaneACL');
cy.wait('@getApiEndpoints');
cy.wait('@getLinodeTypes');
cy.wait([
'@createCluster',
'@getCluster',
'@getClusterPools',
'@getDashboardUrl',
'@getControlPlaneACL',
'@getApiEndpoints',
'@getLinodeTypes'
]);

mockedLKEClusterPools,
mockedLKEClusterTypes
);

it('can create an LKE cluster', () => {
cy.tag('method:e2e', 'purpose:dcTesting');
Copy link
Member

Choose a reason for hiding this comment

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

Now that we are mocking, do we need to update these tags?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! @abailly-akamai I think in this case you can remove the cy.tag(...) call altogether since it's not suitable for DC testing without real API requests 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APL e2e Indicates that a PR touches Cypress tests in some way LKE Related to Linode Kubernetes Engine offerings Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants