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: Fix LKE update test failure following feature flag update #11113

Merged

Conversation

jdamore-linode
Copy link
Contributor

Description 📝

We recently enabled the APL feature flag for development environments which triggered a test failure in lke-update.spec.ts. This change fixes the failing test by mocking the apl feature flag to be disabled.

Changes 🔄

List any change relevant to the reviewer.

  • Mock apl feature flag to be disabled
  • Wrap existing tests in new describe block to signal that the tests apply to LKE with APL disabled

Target release date 🗓️

N/A

How to test 🧪

yarn cy:run -s "cypress/e2e/core/kubernetes/lke-update.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

@jdamore-linode jdamore-linode requested a review from a team as a code owner October 16, 2024 17:10
@jdamore-linode jdamore-linode requested review from AzureLatte and removed request for a team October 16, 2024 17:10
@jdamore-linode jdamore-linode requested a review from a team as a code owner October 16, 2024 17:38
@jdamore-linode jdamore-linode requested review from carrillo-erik and jaalah-akamai and removed request for a team October 16, 2024 17:38
Comment on lines +35 to 47
import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';

const mockNodePools = nodePoolFactory.buildList(2);

describe('LKE cluster updates', () => {
/*
* - Confirms UI flow of upgrading a cluster to high availability control plane using mocked data.
* - Confirms that user is shown a warning and agrees to billing changes before upgrading.
* - Confirms that details page updates accordingly after upgrading to high availability.
*/
it('can upgrade to high availability', () => {
const mockCluster = kubernetesClusterFactory.build({
k8s_version: latestKubernetesVersion,
control_plane: {
high_availability: false,
},
// TODO Add LKE update tests to cover flows when APL is enabled.
describe('APL disabled', () => {
beforeEach(() => {
// Mock the APL feature flag to be disabled.
mockAppendFeatureFlags({
apl: false,
});
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wow, didn't realize how massive this diff is!

This chunk of code is the only significant difference (i.e. importing mockAppendFeatureFlags, adding a new describe block, and calling mockAppendFeatureFlags in a new beforeEach hook) -- the rest of the diff is just a result of the new indentation caused by the new describe block

Copy link
Contributor

@coliu-akamai coliu-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 LKE update tests passed!

(I'm starting to write tests for LKE update IP ACL changes, so good to know about this - thanks for catching!)

@coliu-akamai coliu-akamai added the Approved Multiple approvals and ready to merge! label Oct 16, 2024
Copy link

Coverage Report:
Base Coverage: 87.06%
Current Coverage: 87.06%

@jdamore-linode jdamore-linode merged commit 85212bd into linode:develop Oct 16, 2024
21 of 23 checks passed
Copy link

cypress bot commented Oct 16, 2024

Cloud Manager E2E    Run #6685

Run Properties:  status check failed Failed #6685  •  git commit 85212bd566: test: Fix LKE update test failure following feature flag update (#11113)
Project Cloud Manager E2E
Run status status check failed Failed #6685
Run duration 31m 38s
Commit git commit 85212bd566: test: Fix LKE update test failure following feature flag update (#11113)
Committer jdamore-linode
View all properties for this run ↗︎

Test results
Tests that failed  Failures 3
Tests that were flaky  Flaky 6
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 434

Tests for review

Failed  linodes/clone-linode.spec.ts • 1 failed test

View Output Video

Test Artifacts
clone linode > can clone a Linode from Linode details page Screenshots Video
Failed  oneClickApps/one-click-apps.spec.ts • 1 failed test

View Output Video

Test Artifacts
OneClick Apps (OCA) > Lists all the OneClick Apps Screenshots Video
Failed  linodes/rebuild-linode.spec.ts • 1 failed test

View Output Video

Test Artifacts
rebuild linode > cannot rebuild a provisioning linode Screenshots Video
Flakiness  linodes/resize-linode.spec.ts • 1 flaky test

View Output Video

Test Artifacts
resize linode > resizes a linode by increasing size: cold migration Screenshots Video
Flakiness  objectStorageGen2/bucket-create-gen2.spec.ts • 3 flaky tests

View Output Video

Test Artifacts
Object Storage Gen2 create bucket tests > can create a bucket with E0 endpoint type Screenshots Video
Object Storage Gen2 create bucket tests > can create a bucket with E2 endpoint type Screenshots Video
Object Storage Gen2 create bucket tests > can create a bucket with E3 endpoint type Screenshots Video
Flakiness  placementGroups/delete-placement-groups.spec.ts • 1 flaky test

View Output Video

Test Artifacts
Placement Group deletion > can delete with Linodes assigned when unexpected error show up and retry Screenshots Video
Flakiness  kubernetes/lke-create.spec.ts • 1 flaky test

View Output Video

Test Artifacts
LKE Cluster Creation > can create an LKE cluster Screenshots Video

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.

3 participants