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

added modular tests for cluster with topology for all supported k8s v… #422

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

deepakm-ntnx
Copy link
Contributor

@deepakm-ntnx deepakm-ntnx commented Apr 29, 2024

Moved from #374

What this PR does / why we need it:
Goal

  • Make it easy to add custom e2e tests
  • Move all test config/parameters from prow job to code
  • Its unclear from test code as to which variables from nutanix.yaml file are used. We need to make it explicit in the code
  • Make all the tests run with all supported k8s version explicitly instead of depending on prow config manipulation for CI
  • Use Golang option pattern to add parameters without changing the base methods and make it extensible
  • Added only-for-validation too all the new tests so that it does not affect CI till we sort out the labeling strategy

TODO

  • Allow easy functions to install addons/apps/services so that we can run all version with all the apps like kubebench, kubeburner, nutanix services etc for e2e testing
  • add more negative test cases

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

How Has This Been Tested?:

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and test output

Special notes for your reviewer:
Screen Shot 2024-01-31 at 2 59 38 PM
Screen Shot 2024-01-31 at 2 59 21 PM
Screen Shot 2024-01-31 at 2 58 55 PM
Screen Shot 2024-01-31 at 2 58 23 PM
Screen Shot 2024-01-31 at 2 58 03 PM

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:


@deepakm-ntnx
Copy link
Contributor Author

Per #374 (comment)
TODO:
As discussed with @thunderboltsid we will add only-for-validation label to all the clusterclass tests except basic so that CI does not get affected and later streamline the labels and jobs so that we can jobs parallely as well as granular labels

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 26.91%. Comparing base (0e9a496) to head (c1d1fd8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #422   +/-   ##
=======================================
  Coverage   26.91%   26.91%           
=======================================
  Files          19       19           
  Lines        1360     1360           
=======================================
  Hits          366      366           
  Misses        994      994           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thunderboltsid
Copy link
Contributor

/retest

@thunderboltsid
Copy link
Contributor

/retest

@thunderboltsid
Copy link
Contributor

/lgtm
/approve

@nutanix-cn-prow-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deepakm-ntnx, thunderboltsid

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:
  • OWNERS [deepakm-ntnx,thunderboltsid]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepakm-ntnx
Copy link
Contributor Author

make list-e2e LABEL_FILTERS=Kube128
ginkgo -v --trace --dry-run --tags=e2e --label-filter="Kube128" --skip=""clusterctl-Upgrade"" --nodes=1 \
    --no-color=false --output-dir="/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/_artifacts" \
     ./test/e2e -- \
    -e2e.artifacts-folder="/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/_artifacts" \
    -e2e.config="/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/config/nutanix.yaml" \
    -e2e.skip-resource-cleanup=false -e2e.use-existing-cluster=false
Running Suite: capx-e2e - /Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e
==========================================================================================================================
Random Seed: 1714425341

Will run 16 of 82 specs
------------------------------
[SynchronizedBeforeSuite] 
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/e2e_suite_test.go:63
[SynchronizedBeforeSuite] PASSED [0.000 seconds]
------------------------------
SSS
------------------------------
When scaling in cluster with topology  Scale in a cluster with topology from 3 CP node to 1 CP nodes with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-in]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_in_test.go:135
• [0.000 seconds]
------------------------------
When scaling in cluster with topology  Scale in a cluster with topology from 3 Worker node to 1 Worker nodes with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-in]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_in_test.go:144
• [0.000 seconds]
------------------------------
When scaling in cluster with topology  Scale in a cluster with topology from 3 CP and Worker node to 1 CP and Worker nodes with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-in]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_in_test.go:153
• [0.000 seconds]
------------------------------
SSSSSS
------------------------------
When creating a cluster with topology and running kubetest/conformance Create a cluster with topology with version Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-conformance]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_conformance_test.go:105
• [0.000 seconds]
------------------------------
SSSSSSSSSSSS
------------------------------
When upgrading the k8s version of cluster with topology Upgrade a cluster with topology from version Kube127 to Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-upgrade]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_upgrade_test.go:119
• [0.000 seconds]
------------------------------
SSSSSSSSS
------------------------------
When scaling up/down cluster with topology  Scale down a cluster with CP and Worker node machine memory size from 4Gi to 3Gi with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-down]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_up_down_test.go:153
• [0.000 seconds]
------------------------------
SS
------------------------------
When scaling up/down cluster with topology  Scale down a cluster with CP and Worker node VCPUSockets from 3 to 2 with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-down]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_up_down_test.go:180
• [0.000 seconds]
------------------------------
SS
------------------------------
When scaling up/down cluster with topology  Scale down a cluster with CP and Worker node vcpu per socket from 2 to 1 with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-down]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_up_down_test.go:207
• [0.000 seconds]
------------------------------
SS
------------------------------
When scaling up/down cluster with topology  Scale up a cluster with CP and Worker node machine memory size from 3Gi to 4Gi with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-up]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_up_down_test.go:238
• [0.000 seconds]
------------------------------
SS
------------------------------
When scaling up/down cluster with topology  Scale up a cluster with CP and Worker node VCPUSockets from 2 to 3 with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-up]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_up_down_test.go:265
• [0.000 seconds]
------------------------------
SS
------------------------------
When scaling up/down cluster with topology  Scale up a cluster with CP and Worker node vcpu per socket from 1 to 2 with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-up]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_up_down_test.go:292
• [0.000 seconds]
------------------------------
SSSSSSSSS
------------------------------
When scaling out cluster with topology  Scale out a cluster with topology from 1 CP node to 3 CP nodes with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-out]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_out_test.go:135
• [0.000 seconds]
------------------------------
When scaling out cluster with topology  Scale out a cluster with topology from 1 Worker node to 3 Worker nodes with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-out]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_out_test.go:144
• [0.000 seconds]
------------------------------
When scaling out cluster with topology  Scale out a cluster with topology from 1 CP and Worker node to 3 CP and Worker nodes with Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-scale-out]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_scale_out_test.go:153
• [0.000 seconds]
------------------------------
SSSSS
------------------------------
When creating a cluster with topology with mega scale workflow Create a cluster with topology with version Kube128 and 7 CP and 100 workers [clusterclass, only-for-validation, Kube128, cluster-topology-mega-scale]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_mega_scale_test.go:96
• [0.000 seconds]
------------------------------
SSSSSSSSSSS
------------------------------
When creating a cluster with topology with simple workflow Create a cluster with topology with version Kube128 [clusterclass, only-for-validation, Kube128, cluster-topology-basic]
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/cluster_topology_basic_test.go:96
• [0.000 seconds]
------------------------------
S
------------------------------
[SynchronizedAfterSuite] 
/Users/deepak.muley/go/src/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/test/e2e/e2e_suite_test.go:118
[SynchronizedAfterSuite] PASSED [0.000 seconds]
------------------------------

Ran 16 of 82 Specs in 0.002 seconds
SUCCESS! -- 16 Passed | 0 Failed | 0 Pending | 66 Skipped
PASS

Ginkgo ran 1 suite in 37.023648219s
Test Suite Passed

@deepakm-ntnx deepakm-ntnx merged commit 8228f42 into main Apr 30, 2024
12 of 13 checks passed
@deepakm-ntnx deepakm-ntnx deleted the jira/krbn-7891 branch April 30, 2024 15:52
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.

3 participants