Skip to content

Commit

Permalink
fix: integration test for stateful sets
Browse files Browse the repository at this point in the history
  • Loading branch information
gsquared94 committed Nov 10, 2021
1 parent 8f67e8d commit 136534b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
18 changes: 10 additions & 8 deletions integration/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package integration

import (
"fmt"
"testing"

"github.com/GoogleContainerTools/skaffold/integration/skaffold"
Expand Down Expand Up @@ -79,22 +80,23 @@ func TestRenderApplyHelmDeployment(t *testing.T) {
// Ensure that an intentionally broken deployment fails the status check in `skaffold apply`.
func TestApplyStatusCheckFailure(t *testing.T) {
tests := []struct {
description string
manifestFile string
description string
profile string
}{
{
description: "status check for deployment resources",
manifestFile: "deployment.yaml",
description: "status check for deployment resources",
profile: "deployment",
},
{
description: "status check for statefulset resources",
manifestFile: "statefulset.yaml",
description: "status check for statefulset resources",
profile: "statefulset",
},
}
for _, test := range tests {
testutil.Run(t, test.description, func(t *testutil.T) {
err := skaffold.Apply(test.manifestFile).InDir("testdata/apply").Run(t.T)
skaffold.Delete()
ns, _ := SetupNamespace(t.T)
defer skaffold.Delete("-p", test.profile).InDir("testdata/apply").InNs(ns.Name).Run(t.T)
err := skaffold.Apply(fmt.Sprintf("%s.yaml", test.profile)).InDir("testdata/apply").InNs(ns.Name).Run(t.T)
t.CheckError(true, err)
})
}
Expand Down
9 changes: 9 additions & 0 deletions integration/testdata/apply/skaffold.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
apiVersion: skaffold/v2beta26
kind: Config
profiles:
- name: deployment
deploy:
kubectl:
manifests: ["deployment.yaml"]
- name: statefulset
deploy:
kubectl:
manifests: ["statefulset.yaml"]

0 comments on commit 136534b

Please sign in to comment.