-
Notifications
You must be signed in to change notification settings - Fork 17
HYPERFLEET-1185 - feat: add performance tests and tooling #127
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
Merged
openshift-merge-bot
merged 6 commits into
openshift-hyperfleet:main
from
pnguyen44:HYPERFLEET-1185/add-perf
Jun 18, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1b8b8a5
HYPERFLEET-1185 - feat: add performance tests and
pnguyen44 7bb0de2
HYPERFLEET-1185 - chore: address review feedback
pnguyen44 7de1178
HYPERFLEET-1185 - chore: updated tests
pnguyen44 4cdd729
HYPERFLEET-1185 - chore: add shard label to small
pnguyen44 948ce8a
HYPERFLEET-1185 - chore: improve perf test
pnguyen44 9b822c0
HYPERFLEET-1185 - chore: update seed-clusters
pnguyen44 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| QUAY_USER= | ||
| HYPERFLEET_API_URL= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| package cluster | ||
|
|
||
| import ( | ||
| "context" | ||
| "net/http" | ||
| "time" | ||
|
|
||
| "github.com/onsi/ginkgo/v2" | ||
| . "github.com/onsi/gomega" //nolint:staticcheck // dot import for test readability | ||
|
|
||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/api/openapi" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/client" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/helper" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/labels" | ||
| ) | ||
|
|
||
| var _ = ginkgo.Describe("[Suite: cluster][perf] Cascade delete-to-hard-delete latency", | ||
| ginkgo.Label(labels.Tier1, labels.Performance), | ||
| func() { | ||
| var h *helper.Helper | ||
| var clusterID string | ||
| var nodepoolID string | ||
|
|
||
| ginkgo.BeforeEach(func(ctx context.Context) { | ||
| h = helper.New() | ||
|
|
||
| cluster, err := h.Client.CreateClusterFromPayload(ctx, h.TestDataPath("payloads/clusters/cluster-request.json")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| Expect(cluster.Id).NotTo(BeNil(), "cluster ID should be set") | ||
| clusterID = *cluster.Id | ||
|
|
||
| ginkgo.DeferCleanup(func(ctx context.Context) { | ||
| if err := h.CleanupTestCluster(ctx, clusterID); err != nil { | ||
| ginkgo.GinkgoWriter.Printf("Warning: failed to cleanup cluster %s: %v\n", clusterID, err) | ||
| } | ||
| }) | ||
|
|
||
| ginkgo.By("waiting for cluster to reach Reconciled") | ||
| Eventually(h.PollCluster(ctx, clusterID), h.Cfg.Timeouts.Cluster.Reconciled, h.Cfg.Polling.Interval). | ||
| Should(helper.HaveResourceCondition(client.ConditionTypeReconciled, openapi.ResourceConditionStatusTrue)) | ||
|
|
||
| ginkgo.By("creating a nodepool on the cluster") | ||
| nodepool, err := h.Client.CreateNodePoolFromPayload(ctx, clusterID, h.TestDataPath("payloads/nodepools/nodepool-request.json")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| Expect(nodepool.Id).NotTo(BeNil(), "nodepool ID should be set") | ||
| nodepoolID = *nodepool.Id | ||
|
|
||
| ginkgo.DeferCleanup(func(ctx context.Context) { | ||
| if err := h.CleanupTestNodePool(ctx, clusterID, nodepoolID); err != nil { | ||
| ginkgo.GinkgoWriter.Printf("Warning: failed to cleanup nodepool %s: %v\n", nodepoolID, err) | ||
| } | ||
| }) | ||
|
|
||
| ginkgo.By("waiting for nodepool to reach Reconciled") | ||
| Eventually(h.PollNodePool(ctx, clusterID, nodepoolID), h.Cfg.Timeouts.NodePool.Reconciled, h.Cfg.Polling.Interval). | ||
| Should(helper.HaveResourceCondition(client.ConditionTypeReconciled, openapi.ResourceConditionStatusTrue)) | ||
| }) | ||
|
|
||
| ginkgo.It("should cascade-delete a cluster with nodepools and reach hard-delete within acceptable latency", func(ctx context.Context) { | ||
| ginkgo.By("deleting cluster (with attached nodepool) and timing until hard-delete (404)") | ||
| start := time.Now() | ||
|
|
||
| _, err := h.Client.DeleteCluster(ctx, clusterID) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
|
|
||
| Eventually(h.PollClusterHTTPStatus(ctx, clusterID), h.Cfg.Timeouts.Cluster.Deleted, h.Cfg.Polling.Interval). | ||
| Should(Equal(http.StatusNotFound)) | ||
|
|
||
| elapsed := time.Since(start) | ||
| ginkgo.GinkgoWriter.Printf("[PERF] Cluster cascade delete-to-hard-delete latency: %v\n", elapsed) | ||
| }) | ||
| }, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package cluster | ||
|
|
||
| import ( | ||
| "context" | ||
| "time" | ||
|
|
||
| "github.com/onsi/ginkgo/v2" | ||
| . "github.com/onsi/gomega" //nolint:staticcheck // dot import for test readability | ||
|
|
||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/api/openapi" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/client" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/helper" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/labels" | ||
| ) | ||
|
|
||
| var _ = ginkgo.Describe("[Suite: cluster][perf] Create-to-reconciled latency", | ||
| ginkgo.Label(labels.Tier1, labels.Performance), | ||
| func() { | ||
| var h *helper.Helper | ||
| var clusterID string | ||
|
|
||
| ginkgo.BeforeEach(func(ctx context.Context) { | ||
| h = helper.New() | ||
| }) | ||
|
|
||
| ginkgo.It("should create a cluster and reach Reconciled within acceptable latency", func(ctx context.Context) { | ||
| ginkgo.By("creating a cluster and timing until Reconciled") | ||
| start := time.Now() | ||
|
|
||
| cluster, err := h.Client.CreateClusterFromPayload(ctx, h.TestDataPath("payloads/clusters/cluster-request.json")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| Expect(cluster.Id).NotTo(BeNil(), "cluster ID should be set") | ||
| clusterID = *cluster.Id | ||
|
|
||
| ginkgo.DeferCleanup(func(ctx context.Context) { | ||
| if err := h.CleanupTestCluster(ctx, clusterID); err != nil { | ||
| ginkgo.GinkgoWriter.Printf("Warning: failed to cleanup cluster %s: %v\n", clusterID, err) | ||
| } | ||
| }) | ||
|
|
||
| Eventually(h.PollCluster(ctx, clusterID), h.Cfg.Timeouts.Cluster.Reconciled, h.Cfg.Polling.Interval). | ||
| Should(helper.HaveResourceCondition(client.ConditionTypeReconciled, openapi.ResourceConditionStatusTrue)) | ||
|
|
||
| elapsed := time.Since(start) | ||
| ginkgo.GinkgoWriter.Printf("[PERF] Cluster create-to-reconciled latency: %v\n", elapsed) | ||
| }) | ||
| }, | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| package cluster | ||
|
|
||
| import ( | ||
| "context" | ||
| "net/http" | ||
| "time" | ||
|
|
||
| "github.com/onsi/ginkgo/v2" | ||
| . "github.com/onsi/gomega" //nolint:staticcheck // dot import for test readability | ||
|
|
||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/api/openapi" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/client" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/helper" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/labels" | ||
| ) | ||
|
|
||
| var _ = ginkgo.Describe("[Suite: cluster][perf] Delete-to-hard-delete latency", | ||
| ginkgo.Label(labels.Tier1, labels.Performance), | ||
| func() { | ||
| var h *helper.Helper | ||
| var clusterID string | ||
|
|
||
| ginkgo.BeforeEach(func(ctx context.Context) { | ||
| h = helper.New() | ||
|
|
||
| cluster, err := h.Client.CreateClusterFromPayload(ctx, h.TestDataPath("payloads/clusters/cluster-request.json")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| Expect(cluster.Id).NotTo(BeNil(), "cluster ID should be set") | ||
| clusterID = *cluster.Id | ||
|
|
||
| ginkgo.DeferCleanup(func(ctx context.Context) { | ||
| if err := h.CleanupTestCluster(ctx, clusterID); err != nil { | ||
| ginkgo.GinkgoWriter.Printf("Warning: failed to cleanup cluster %s: %v\n", clusterID, err) | ||
| } | ||
| }) | ||
|
|
||
| ginkgo.By("waiting for cluster to reach Reconciled before delete") | ||
| Eventually(h.PollCluster(ctx, clusterID), h.Cfg.Timeouts.Cluster.Reconciled, h.Cfg.Polling.Interval). | ||
| Should(helper.HaveResourceCondition(client.ConditionTypeReconciled, openapi.ResourceConditionStatusTrue)) | ||
| }) | ||
|
|
||
| ginkgo.It("should delete a cluster and reach hard-delete within acceptable latency", func(ctx context.Context) { | ||
| ginkgo.By("deleting cluster and timing until hard-delete (404)") | ||
| start := time.Now() | ||
|
|
||
| _, err := h.Client.DeleteCluster(ctx, clusterID) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
|
|
||
| Eventually(h.PollClusterHTTPStatus(ctx, clusterID), h.Cfg.Timeouts.Cluster.Deleted, h.Cfg.Polling.Interval). | ||
| Should(Equal(http.StatusNotFound)) | ||
|
|
||
| elapsed := time.Since(start) | ||
| ginkgo.GinkgoWriter.Printf("[PERF] Cluster delete-to-hard-delete latency: %v\n", elapsed) | ||
| }) | ||
| }, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| package cluster | ||
|
|
||
| import ( | ||
| "context" | ||
| "time" | ||
|
|
||
| "github.com/onsi/ginkgo/v2" | ||
| . "github.com/onsi/gomega" //nolint:staticcheck // dot import for test readability | ||
|
|
||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/api/openapi" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/helper" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/labels" | ||
| ) | ||
|
|
||
| var _ = ginkgo.Describe("[Suite: cluster][perf] API list latency with filters and pagination", | ||
| ginkgo.Label(labels.Tier1, labels.Performance), | ||
| func() { | ||
| var h *helper.Helper | ||
| var clusterID string | ||
|
|
||
| ginkgo.BeforeEach(func(ctx context.Context) { | ||
| h = helper.New() | ||
|
|
||
| cluster, err := h.Client.CreateClusterFromPayload(ctx, h.TestDataPath("payloads/clusters/cluster-request.json")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| Expect(cluster.Id).NotTo(BeNil(), "cluster ID should be set") | ||
| clusterID = *cluster.Id | ||
|
|
||
| ginkgo.DeferCleanup(func(ctx context.Context) { | ||
| if err := h.CleanupTestCluster(ctx, clusterID); err != nil { | ||
| ginkgo.GinkgoWriter.Printf("Warning: failed to cleanup cluster %s: %v\n", clusterID, err) | ||
| } | ||
| }) | ||
| }) | ||
|
|
||
| ginkgo.It("should list clusters with search filter within acceptable latency", func(ctx context.Context) { | ||
| ginkgo.By("measuring GET /clusters?search=... response time") | ||
| filter := openapi.SearchParams("labels.environment='test'") | ||
| start := time.Now() | ||
| _, err := h.Client.ListClustersWithParams(ctx, &openapi.GetClustersParams{ | ||
| Search: &filter, | ||
| }) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| elapsed := time.Since(start) | ||
| ginkgo.GinkgoWriter.Printf("[PERF] GET /clusters (search filter) latency: %v\n", elapsed) | ||
| }) | ||
|
|
||
| ginkgo.It("should list clusters with page size limit within acceptable latency", func(ctx context.Context) { | ||
| ginkgo.By("measuring GET /clusters?pageSize=10 response time") | ||
| pageSize := openapi.QueryParamsPageSize(10) | ||
| start := time.Now() | ||
| _, err := h.Client.ListClustersWithParams(ctx, &openapi.GetClustersParams{ | ||
| PageSize: &pageSize, | ||
| }) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| elapsed := time.Since(start) | ||
| ginkgo.GinkgoWriter.Printf("[PERF] GET /clusters (pageSize=10) latency: %v\n", elapsed) | ||
| }) | ||
|
|
||
| ginkgo.It("should list clusters with pagination within acceptable latency", func(ctx context.Context) { | ||
| ginkgo.By("measuring GET /clusters?page=1&pageSize=10 response time") | ||
| page := openapi.QueryParamsPage(1) | ||
| pageSize := openapi.QueryParamsPageSize(10) | ||
| start := time.Now() | ||
| _, err := h.Client.ListClustersWithParams(ctx, &openapi.GetClustersParams{ | ||
| Page: &page, | ||
| PageSize: &pageSize, | ||
| }) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| elapsed := time.Since(start) | ||
| ginkgo.GinkgoWriter.Printf("[PERF] GET /clusters (page=1, pageSize=10) latency: %v\n", elapsed) | ||
| }) | ||
| }, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| package cluster | ||
|
|
||
| import ( | ||
| "context" | ||
| "time" | ||
|
|
||
| "github.com/onsi/ginkgo/v2" | ||
| . "github.com/onsi/gomega" //nolint:staticcheck // dot import for test readability | ||
|
|
||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/helper" | ||
| "github.com/openshift-hyperfleet/hyperfleet-e2e/pkg/labels" | ||
| ) | ||
|
|
||
| var _ = ginkgo.Describe("[Suite: cluster][perf] API list latency", | ||
| ginkgo.Label(labels.Tier1, labels.Performance), | ||
| func() { | ||
| var h *helper.Helper | ||
| var clusterID string | ||
|
|
||
| ginkgo.BeforeEach(func(ctx context.Context) { | ||
| h = helper.New() | ||
|
|
||
| cluster, err := h.Client.CreateClusterFromPayload(ctx, h.TestDataPath("payloads/clusters/cluster-request.json")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| Expect(cluster.Id).NotTo(BeNil(), "cluster ID should be set") | ||
| clusterID = *cluster.Id | ||
|
|
||
| ginkgo.DeferCleanup(func(ctx context.Context) { | ||
| if err := h.CleanupTestCluster(ctx, clusterID); err != nil { | ||
| ginkgo.GinkgoWriter.Printf("Warning: failed to cleanup cluster %s: %v\n", clusterID, err) | ||
| } | ||
| }) | ||
| }) | ||
|
|
||
| ginkgo.It("should list clusters within acceptable latency", func(ctx context.Context) { | ||
| ginkgo.By("measuring GET /clusters response time") | ||
| start := time.Now() | ||
| _, err := h.Client.ListClusters(ctx) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| elapsed := time.Since(start) | ||
| ginkgo.GinkgoWriter.Printf("[PERF] GET /clusters latency: %v\n", elapsed) | ||
| }) | ||
| }, | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.