Skip to content

Commit

Permalink
Fix snapshot test failure
Browse files Browse the repository at this point in the history
Signed-off-by: Emruz Hossain <emruz@appscode.com>
  • Loading branch information
Emruz Hossain committed Sep 26, 2022
1 parent 583a8f5 commit f209179
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions test/e2e/misc/snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ var _ = Describe("Snapshot Tests", func() {
var (
deployWorkloads = func(securityContext *core.SecurityContext) []testResources {
var resources []testResources
//// Deploy a DaemonSet
//dmn, err := f.DeployDaemonSet(framework.SourceDaemonSet, framework.SourceVolume, func(dmn *apps.DaemonSet) {
// dmn.Spec.Template.Spec.Containers[0].SecurityContext = securityContext
//})
//Expect(err).NotTo(HaveOccurred())
//
//// Generate Sample Data
//_, err = f.GenerateSampleData(dmn.ObjectMeta, apis.KindDaemonSet)
//Expect(err).NotTo(HaveOccurred())
//resources = append(resources, testResources{workloadMeta: dmn.ObjectMeta, workloadKind: apis.KindDaemonSet, workload: dmn})

// Deploy a Deployment
deployment, err := f.DeployDeployment(framework.SourceDeployment, int32(1), framework.SourceVolume, func(dp *apps.Deployment) {
dp.Spec.Template.Spec.Containers[0].SecurityContext = securityContext
Expand All @@ -74,27 +85,16 @@ var _ = Describe("Snapshot Tests", func() {
Expect(err).NotTo(HaveOccurred())
resources = append(resources, testResources{workloadMeta: deployment.ObjectMeta, workloadKind: apis.KindDeployment, workload: deployment})

//// Deploy a StatefulSet
//ss, err := f.DeployStatefulSet(framework.SourceStatefulSet, int32(3), framework.SourceVolume, func(ss *apps.StatefulSet) {
// ss.Spec.Template.Spec.Containers[0].SecurityContext = securityContext
//})
//Expect(err).NotTo(HaveOccurred())
//
//// Generate Sample Data
//_, err = f.GenerateSampleData(ss.ObjectMeta, apis.KindStatefulSet)
//Expect(err).NotTo(HaveOccurred())
//resources = append(resources, testResources{workloadMeta: ss.ObjectMeta, workloadKind: apis.KindStatefulSet, workload: ss})

// Deploy a DaemonSet
dmn, err := f.DeployDaemonSet(framework.SourceDaemonSet, framework.SourceVolume, func(dmn *apps.DaemonSet) {
dmn.Spec.Template.Spec.Containers[0].SecurityContext = securityContext
// Deploy a StatefulSet
ss, err := f.DeployStatefulSet(framework.SourceStatefulSet, int32(2), framework.SourceVolume, func(ss *apps.StatefulSet) {
ss.Spec.Template.Spec.Containers[0].SecurityContext = securityContext
})
Expect(err).NotTo(HaveOccurred())

// Generate Sample Data
_, err = f.GenerateSampleData(dmn.ObjectMeta, apis.KindDaemonSet)
_, err = f.GenerateSampleData(ss.ObjectMeta, apis.KindStatefulSet)
Expect(err).NotTo(HaveOccurred())
resources = append(resources, testResources{workloadMeta: dmn.ObjectMeta, workloadKind: apis.KindDaemonSet, workload: dmn})
resources = append(resources, testResources{workloadMeta: ss.ObjectMeta, workloadKind: apis.KindStatefulSet, workload: ss})

return resources
}
Expand Down

0 comments on commit f209179

Please sign in to comment.