Skip to content

Commit 2a35e6c

Browse files
committed
add vac pvc e2e tests gcp driver
1 parent a647310 commit 2a35e6c

3 files changed

Lines changed: 191 additions & 169 deletions

File tree

frontend/packages/integration-tests/mocks/volume-attributes-class.ts

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,68 @@ import type { DeploymentKind } from '@console/internal/module/k8s';
22

33
// Factory function to generate unique fixture names and objects per test run
44
// This prevents collisions when tests run concurrently on shared clusters
5+
// Configuration tested and working on GCP with hyperdisk-balanced
56
export const getVACFixtures = (suffix: string) => {
67
const names = {
7-
TEST_VAC_LOW_IOPS: `test-vac-low-iops-${suffix}`,
8-
TEST_VAC_HIGH_IOPS: `test-vac-high-iops-${suffix}`,
9-
TEST_VAC_INVALID: `test-vac-invalid-${suffix}`,
10-
TEST_STORAGECLASS: `test-storageclass-${suffix}`,
8+
TEST_VAC_STANDARD: `gcp-vac-standard-${suffix}`,
9+
TEST_VAC_PERFORMANCE: `gcp-vac-performance-${suffix}`,
10+
TEST_VAC_INVALID: `gcp-vac-invalid-${suffix}`,
11+
TEST_STORAGECLASS: `gcp-hyperdisk-sc-${suffix}`,
1112
// Namespace-scoped, no suffix needed
1213
TEST_PVC: 'test-pvc',
1314
TEST_DEPLOYMENT: 'test-deployment',
1415
};
1516

1617
return {
1718
...names,
18-
VAC_LOW_IOPS: {
19+
// Standard tier VAC
20+
VAC_STANDARD: {
1921
apiVersion: 'storage.k8s.io/v1',
2022
kind: 'VolumeAttributesClass',
21-
metadata: { name: names.TEST_VAC_LOW_IOPS },
22-
driverName: 'ebs.csi.aws.com',
23-
parameters: { iops: '3000', throughput: '125', type: 'gp3' },
23+
metadata: { name: names.TEST_VAC_STANDARD },
24+
driverName: 'pd.csi.storage.gke.io',
25+
parameters: {
26+
iops: '3000',
27+
throughput: '140Mi',
28+
},
2429
},
25-
VAC_HIGH_IOPS: {
30+
// Performance tier VAC - uses identical parameters to VAC_STANDARD to minimize CSI driver
31+
// modification time and reduce test flakiness. This allows verification of VAC name fields
32+
// on the PVC details page without long waits for actual volume operations.
33+
VAC_PERFORMANCE: {
2634
apiVersion: 'storage.k8s.io/v1',
2735
kind: 'VolumeAttributesClass',
28-
metadata: { name: names.TEST_VAC_HIGH_IOPS },
29-
driverName: 'ebs.csi.aws.com',
30-
// Uses identical parameters to VAC_LOW_IOPS to minimize CSI driver modification time and reduce test flakiness.
31-
// This allows verification of VAC name fields on the PVC details page without long waits for actual volume operations.
32-
parameters: { iops: '3000', throughput: '125', type: 'gp3' },
36+
metadata: { name: names.TEST_VAC_PERFORMANCE },
37+
driverName: 'pd.csi.storage.gke.io',
38+
parameters: {
39+
iops: '3000',
40+
throughput: '140Mi',
41+
},
3342
},
43+
// Invalid VAC - exceeds limits to trigger error
3444
VAC_INVALID: {
3545
apiVersion: 'storage.k8s.io/v1',
3646
kind: 'VolumeAttributesClass',
3747
metadata: { name: names.TEST_VAC_INVALID },
38-
driverName: 'ebs.csi.aws.com',
39-
parameters: { iops: '999999', throughput: '999999', type: 'gp3' },
48+
driverName: 'pd.csi.storage.gke.io',
49+
parameters: {
50+
iops: '999999',
51+
throughput: '999999Mi',
52+
},
4053
},
54+
// GCP hyperdisk-balanced StorageClass
4155
STORAGE_CLASS: {
4256
apiVersion: 'storage.k8s.io/v1',
4357
kind: 'StorageClass',
4458
metadata: { name: names.TEST_STORAGECLASS },
45-
provisioner: 'ebs.csi.aws.com',
59+
provisioner: 'pd.csi.storage.gke.io',
60+
parameters: {
61+
type: 'hyperdisk-balanced',
62+
},
63+
volumeBindingMode: 'WaitForFirstConsumer',
4664
allowVolumeExpansion: true,
4765
},
66+
// Deployment to consume the PVC
4867
getDeployment: (namespace: string, pvcName: string): DeploymentKind => ({
4968
apiVersion: 'apps/v1',
5069
kind: 'Deployment',

frontend/packages/integration-tests/tests/crud/resource-crud.cy.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,18 @@ describe('Kubernetes resource CRUD operations', () => {
7878
kind: 'snapshot.storage.k8s.io~v1~VolumeSnapshotContent',
7979
namespaced: false,
8080
})
81-
.set('storage.k8s.io~v1~VolumeAttributesClass', {
82-
kind: 'storage.k8s.io~v1~VolumeAttributesClass',
83-
namespaced: false,
84-
})
8581
: OrderedMap<string, TestDefinition>();
8682

87-
const k8sObjsWithSnapshots = k8sObjs.merge(snapshotObjs);
83+
// VolumeAttributesClass - E2E tests run on GCP with Hyperdisk CSI driver
84+
const vacObjs = OrderedMap<string, TestDefinition>().set(
85+
'storage.k8s.io~v1~VolumeAttributesClass',
86+
{
87+
kind: 'storage.k8s.io~v1~VolumeAttributesClass',
88+
namespaced: false,
89+
},
90+
);
91+
92+
const k8sObjsWithSnapshots = k8sObjs.merge(snapshotObjs).merge(vacObjs);
8893

8994
const openshiftObjs = OrderedMap<string, TestDefinition>()
9095
.set('deploymentconfigs', {

0 commit comments

Comments
 (0)