Add missing unit tests
@@ -164,3 +164,31 @@ func TestIsTargetImage(t *testing.T) {
})
}
}
+
+func TestForceDeploy(t *testing.T) {
+ opts := SkaffoldOptions{}
+ testutil.CheckDeepEqual(t, false, opts.ForceDeploy())
+
+ opts = SkaffoldOptions{ForceDev: true}
+ testutil.CheckDeepEqual(t, true, opts.ForceDeploy())
+
+ opts = SkaffoldOptions{Force: true}
+ testutil.CheckDeepEqual(t, true, opts.ForceDeploy())
+
+ opts = SkaffoldOptions{ForceDev: true, Force: true}
+ testutil.CheckDeepEqual(t, true, opts.ForceDeploy())
+}
+
+func TestPrune(t *testing.T) {
+ opts := SkaffoldOptions{}
+ testutil.CheckDeepEqual(t, true, opts.Prune())
+
+ opts = SkaffoldOptions{NoPrune: true}
+ testutil.CheckDeepEqual(t, false, opts.Prune())
+
+ opts = SkaffoldOptions{CacheArtifacts: true}
+ testutil.CheckDeepEqual(t, false, opts.Prune())
+
+ opts = SkaffoldOptions{NoPrune: true, CacheArtifacts: true}
+ testutil.CheckDeepEqual(t, false, opts.Prune())
+}
