Skip to content

Commit f62e8dc

Browse files
gsquared94tejal29
andauthored
test: fix integration test for stateful-sets (#6829)
* fix: integration test for stateful sets * fix imtegration tests to only run on GCP Co-authored-by: tejal29 <[email protected]>
1 parent 256f88a commit f62e8dc

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

integration/apply_test.go

+11-8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package integration
1818

1919
import (
20+
"fmt"
2021
"testing"
2122

2223
"github.com/GoogleContainerTools/skaffold/integration/skaffold"
@@ -79,22 +80,24 @@ func TestRenderApplyHelmDeployment(t *testing.T) {
7980
// Ensure that an intentionally broken deployment fails the status check in `skaffold apply`.
8081
func TestApplyStatusCheckFailure(t *testing.T) {
8182
tests := []struct {
82-
description string
83-
manifestFile string
83+
description string
84+
profile string
8485
}{
8586
{
86-
description: "status check for deployment resources",
87-
manifestFile: "deployment.yaml",
87+
description: "status check for deployment resources",
88+
profile: "deployment",
8889
},
8990
{
90-
description: "status check for statefulset resources",
91-
manifestFile: "statefulset.yaml",
91+
description: "status check for statefulset resources",
92+
profile: "statefulset",
9293
},
9394
}
9495
for _, test := range tests {
9596
testutil.Run(t, test.description, func(t *testutil.T) {
96-
err := skaffold.Apply(test.manifestFile).InDir("testdata/apply").Run(t.T)
97-
skaffold.Delete()
97+
MarkIntegrationTest(t.T, NeedsGcp)
98+
ns, _ := SetupNamespace(t.T)
99+
defer skaffold.Delete("-p", test.profile).InDir("testdata/apply").InNs(ns.Name).Run(t.T)
100+
err := skaffold.Apply(fmt.Sprintf("%s.yaml", test.profile)).InDir("testdata/apply").InNs(ns.Name).Run(t.T)
98101
t.CheckError(true, err)
99102
})
100103
}
+9
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
apiVersion: skaffold/v2beta26
22
kind: Config
3+
profiles:
4+
- name: deployment
5+
deploy:
6+
kubectl:
7+
manifests: ["deployment.yaml"]
8+
- name: statefulset
9+
deploy:
10+
kubectl:
11+
manifests: ["statefulset.yaml"]

0 commit comments

Comments
 (0)