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

chore: adjust backup e2e test cases #5604

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ else
endif

.PHONY: test-e2e
test-e2e: helm-package render-smoke-testdata-manifests ## Run E2E tests.
test-e2e: helm-package install-s3-csi-driver render-smoke-testdata-manifests ## Run E2E tests.
$(MAKE) -e VERSION=$(VERSION) PROVIDER=$(PROVIDER) REGION=$(REGION) SECRET_ID=$(SECRET_ID) SECRET_KEY=$(SECRET_KEY) INIT_ENV=$(INIT_ENV) TEST_TYPE=$(TEST_TYPE) SKIP_CASE=$(SKIP_CASE) CONFIG_TYPE=$(CONFIG_TYPE) -C test/e2e run

.PHONY: render-smoke-testdata-manifests-local
Expand Down
10 changes: 0 additions & 10 deletions test/e2e/testdata/smoketest/mongodb/09_backup_snapshot.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: Backup
metadata:
name: backup-mongodb-cluster-snapshot
spec:
backupPolicyName: mongodb-cluster-mongodb-backup-policy
retentionPeriod: 7d
backupMethod: volume-snapshot
deletionPolicy: Delete
status:
duration: 60s
backupRepoName: my-repo
phase: Completed
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# Source: mongodb-cluster/templates/replicaset.yaml
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: mongo-cluster-snapshot
annotations:
kubeblocks.io/restore-from-backup: '{"mongodb":{"name":"backup-mongodb-cluster-snapshot","namespace":"default","managementPolicy":"Parallel"}}'
spec:
clusterDefinitionRef: mongodb
clusterVersionRef: mongodb-5.0
terminationPolicy: Halt
affinity:
topologyKeys:
- kubernetes.io/hostname
componentSpecs:
- name: mongodb
componentDefRef: mongodb
monitor: false
replicas: 3
serviceAccountName: kb-mongodb-cluster
volumeClaimTemplates:
- name: data # ref clusterdefinition components.containers.volumeMounts.name
spec:
storageClassName:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 21Gi
13 changes: 13 additions & 0 deletions test/e2e/testdata/smoketest/mongodb/11_backup_datafile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: Backup
metadata:
name: backup-mongodb-cluster
spec:
backupPolicyName: mongodb-cluster-mongodb-backup-policy
retentionPeriod: 7d
backupMethod: datafile
deletionPolicy: Delete
status:
duration: 60s
backupRepoName: my-repo
phase: Completed
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: mongocluster-snapshot
name: mongo-cluster-datafile
annotations:
kubeblocks.io/restore-from-backup: "{\"mongodb\":\"backup-snapshot-mongocluster\"}"
kubeblocks.io/restore-from-backup: '{"mongodb":{"name":"backup-mongodb-cluster","namespace":"default","managementPolicy":"Parallel"}}'
spec:
clusterDefinitionRef: mongodb
clusterVersionRef: mongodb-5.0.14
clusterVersionRef: mongodb-5.0
terminationPolicy: Halt
affinity:
topologyKeys:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: kb-pg-cluster
namespace: default
labels:
helm.sh/chart: postgresql-cluster-0.7.0-alpha.0
helm.sh/chart: postgresql-cluster-0.8.0-alpha.0
app.kubernetes.io/version: "14.8.0"
app.kubernetes.io/instance: pg-cluster
---
Expand All @@ -16,7 +16,7 @@ kind: ClusterRoleBinding
metadata:
name: kb-pg-cluster
labels:
helm.sh/chart: postgresql-cluster-0.7.0-alpha.0
helm.sh/chart: postgresql-cluster-0.8.0-alpha.0
app.kubernetes.io/version: "14.8.0"
app.kubernetes.io/instance: pg-cluster
roleRef:
Expand All @@ -34,7 +34,7 @@ kind: RoleBinding
metadata:
name: kb-pg-cluster
labels:
helm.sh/chart: postgresql-cluster-0.7.0-alpha.0
helm.sh/chart: postgresql-cluster-0.8.0-alpha.0
app.kubernetes.io/version: "14.8.0"
app.kubernetes.io/instance: pg-cluster
roleRef:
Expand All @@ -53,7 +53,7 @@ metadata:
name: pg-cluster
namespace: default
labels:
helm.sh/chart: postgresql-cluster-0.7.0-alpha.0
helm.sh/chart: postgresql-cluster-0.8.0-alpha.0
app.kubernetes.io/version: "14.8.0"
app.kubernetes.io/instance: pg-cluster
spec:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: Backup
metadata:
name: backup-postgresql-cluster
spec:
backupPolicyName: pg-cluster-postgresql-backup-policy
retentionPeriod: 7d
backupMethod: pg-basebackup
deletionPolicy: Delete
status:
duration: 60s
backupRepoName: my-repo
phase: Completed
10 changes: 0 additions & 10 deletions test/e2e/testdata/smoketest/postgresql/11_backup_snapshot.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# Source: postgresql-cluster/templates/cluster.yaml
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: pg-cluster-snapshot
annotations:
kubeblocks.io/restore-from-backup: '{"postgresql":{"name":"backup-postgresql-cluster","namespace":"default","managementPolicy":"Parallel"}}'
spec:
clusterDefinitionRef: postgresql
clusterVersionRef: postgresql-14.7.2-latest
terminationPolicy: WipeOut
componentSpecs:
- name: postgresql
componentDefRef: postgresql
serviceAccountName: kb-mycluster-pgcluster
monitor: false
replicas: 1
volumeClaimTemplates:
- name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 21Gi

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: Backup
metadata:
name: backup-postgresql-cluster-snapshot
spec:
backupPolicyName: pg-cluster-postgresql-backup-policy
retentionPeriod: 7d
backupMethod: volume-snapshot
deletionPolicy: Delete
status:
duration: 60s
backupRepoName: my-repo
phase: Completed
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# Source: postgresql-cluster/templates/cluster.yaml
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: pg-cluster-snapshot
annotations:
kubeblocks.io/restore-from-backup: '{"postgresql":{"name":"backup-postgresql-cluster-snapshot","namespace":"default","managementPolicy":"Parallel"}}'
spec:
clusterDefinitionRef: postgresql
clusterVersionRef: postgresql-14.7.2-latest
terminationPolicy: WipeOut
componentSpecs:
- name: postgresql
componentDefRef: postgresql
serviceAccountName: kb-mycluster-pgcluster
monitor: false
replicas: 1
volumeClaimTemplates:
- name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 21Gi
10 changes: 0 additions & 10 deletions test/e2e/testdata/smoketest/redis/09_backup_snapshot.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dataprotection.kubeblocks.io/v1alpha1
kind: Backup
metadata:
name: backup-redis-cluster-snapshot
spec:
backupPolicyName: redis-cluster-redis-backup-policy
retentionPeriod: 7d
backupMethod: volume-snapshot
deletionPolicy: Delete
status:
duration: 60s
backupRepoName: my-repo
phase: Completed
Loading