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

Enable test for persistent storage #303

Merged
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
12 changes: 8 additions & 4 deletions test/e2e/v1beta1/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,12 @@ func TestHabitatDelete(t *testing.T) {
}

func TestPersistentStorage(t *testing.T) {
// We run minikube in a VM on the CI infrastructure. In that environment, we cannot create PersistentVolumes.
t.Skip("This test cannot be run successfully in our current testing setup")

ephemeral, err := utils.ConvertHabitat("resources/standalone/habitat.yml")
if err != nil {
t.Fatal(err)
}

persisted, err := utils.ConvertHabitat("resources/persisted/habitat.yml")
persisted, err := utils.ConvertHabitat("resources/persistent/habitat.yml")
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -255,6 +252,13 @@ func TestPersistentStorage(t *testing.T) {
}
})(persisted.Name)

// Delete the ephemeral resource created
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also do the same for persistent one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, other tests do not use it so I skipped it instead. The whole cluster still gets deleted at the end of the test anyway.

defer (func(name string) {
if err := framework.DeleteHabitat(name); err != nil {
t.Fatal(err)
}
})(ephemeral.Name)

if err := framework.WaitForResources(habv1beta1.HabitatNameLabel, persisted.Name, 1); err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/v1beta1/resources/persistent/habitat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ apiVersion: habitat.sh/v1beta1
kind: Habitat
metadata:
name: persisted-test
customVersion: v1beta2
spec:
v1beta2:
image: kinvolk/redis-hab
count: 1
persistentStorage:
size: 100Mi
# created by minikube
# created by default on GCP
storageClassName: standard
mountPath: /tmp/foo
service:
Expand Down