Skip to content

Commit

Permalink
Skip vol-snapshot test in minikube (#4225)
Browse files Browse the repository at this point in the history
  • Loading branch information
SupriyaKasten authored Oct 23, 2018
1 parent 2f5e56d commit 1964493
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions pkg/function/volume_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package function

import (
"context"
"strings"

. "gopkg.in/check.v1"
appsv1 "k8s.io/api/apps/v1"
Expand All @@ -19,6 +20,13 @@ import (
"github.com/kanisterio/kanister/pkg/testutil"
)

const (
volumeSnapshotInfoKey = "volumeSnapshotInfo"
manifestKey = "manifest"
backupInfoKey = "backupInfo"
skipTestErrorMsg = "Storage type not supported"
)

type VolumeSnapshotTestSuite struct {
cli kubernetes.Interface
crCli versioned.Interface
Expand Down Expand Up @@ -221,16 +229,21 @@ func (s *VolumeSnapshotTestSuite) TestVolumeSnapshot(c *C) {
c.Assert(err, IsNil)
for _, p := range phases {
output, err := p.Exec(ctx, *bp, action, *tp)
if err != nil && strings.Contains(err.Error(), skipTestErrorMsg) {
c.Skip("Skipping the test since storage type not supported")
}
c.Assert(err, IsNil)
if action == "backup" {
keyval := make(map[string]string)
keyval["manifest"] = output["volumeSnapshotInfo"].(string)
c.Assert(output, NotNil)
c.Assert(output[volumeSnapshotInfoKey], NotNil)
keyval[manifestKey] = output[volumeSnapshotInfoKey].(string)
artifact := crv1alpha1.Artifact{
KeyValue: keyval,
}
tp.ArtifactsIn = make(map[string]crv1alpha1.Artifact)
tp.ArtifactsIn["backupInfo"] = artifact
tp.ArtifactsIn[backupInfoKey] = artifact
}
c.Assert(err, IsNil)
}
}
}

0 comments on commit 1964493

Please sign in to comment.