Test Sync mode with both triggers
@@ -27,6 +27,21 @@ import (
)
func TestDevSync(t *testing.T) {
+ var tests = []struct {
+ description string
+ trigger string
+ }{
+ {
+ description: "sync with polling trigger",
+ trigger: "polling",
+ },
+ {
+ description: "sync with notify trigger",
+ trigger: "notify",
+ },
+ }
+ for _, test := range tests {
+ t.Run(test.description, func(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
@@ -34,12 +49,13 @@ func TestDevSync(t *testing.T) {
t.Skip("skipping test that is not gcp only")
}
+ // Run skaffold build first to fail quickly on a build failure
+ skaffold.Build().InDir("testdata/file-sync").RunOrFail(t)
+
ns, client, deleteNs := SetupNamespace(t)
defer deleteNs()
- skaffold.Build().InDir("testdata/file-sync").InNs(ns.Name).RunOrFail(t)
-
- stop := skaffold.Dev().InDir("testdata/file-sync").InNs(ns.Name).RunBackground(t)
+ stop := skaffold.Dev("--trigger", test.trigger).InDir("testdata/file-sync").InNs(ns.Name).RunBackground(t)
defer stop()
client.WaitForPodsReady("test-file-sync")
@@ -53,4 +69,6 @@ func TestDevSync(t *testing.T) {
return err == nil, nil
})
testutil.CheckError(t, false, err)
+ })
+ }
}
