diff --git a/cli/pipeline/pipeline_definition_test.go b/cli/pipeline/pipeline_definition_test.go index f7694ae..49dddc8 100644 --- a/cli/pipeline/pipeline_definition_test.go +++ b/cli/pipeline/pipeline_definition_test.go @@ -10,10 +10,10 @@ func TestParsePipeline(t *testing.T) { if err != nil { panic(err.Error()) } - pipeline := parsePipeline(data) + pipeline := ParsePipeline(data) if len(pipeline.Steps) != 2 { - t.Errorf("excepted two steps, got %d", len(pipeline.Steps)) + t.Errorf("expected two steps, got %d", len(pipeline.Steps)) } if pipeline.Bucket != "canoe-sample-pipeline" { @@ -26,7 +26,7 @@ func TestOverrideTag(t *testing.T) { if err != nil { panic(err.Error()) } - pipeline := parsePipeline(data) + pipeline := ParsePipeline(data) pipeline.Steps[0].OverrideTag("") @@ -46,7 +46,7 @@ func TestOverrideVersion(t *testing.T) { if err != nil { panic(err.Error()) } - pipeline := parsePipeline(data) + pipeline := ParsePipeline(data) pipeline.Steps[0].OverrideVersion("", true) @@ -70,7 +70,7 @@ func TestOverrideBranch(t *testing.T) { if err != nil { panic(err.Error()) } - pipeline := parsePipeline(data) + pipeline := ParsePipeline(data) pipeline.Steps[0].OverrideBranch("", true) diff --git a/cli/pipeline/run_test.go b/cli/pipeline/run_test.go index d340253..7a740b5 100644 --- a/cli/pipeline/run_test.go +++ b/cli/pipeline/run_test.go @@ -2,15 +2,16 @@ package pipeline import ( "fmt" - "k8s.io/api/core/v1" + "testing" + "time" + + v1 "k8s.io/api/core/v1" k8errors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes/fake" ktesting "k8s.io/client-go/testing" - "testing" - "time" ) func parseTimeOrDie(ts string) metav1.Time { @@ -112,11 +113,11 @@ func TestRunPipelineSuccess(t *testing.T) { expectPods := [2]string{"sample-steps-passing-version1-step1-master", "sample-steps-passing-version1a-step2-master"} for _, p := range expectPods { - if deleted[p] != 2 { - t.Errorf("excepted delete of "+p+" to be called twice, got %i", deleted[p]) + if deleted[p] != 3 { + t.Errorf("expected delete of "+p+" to be called twice, got %i", deleted[p]) } if created[p] != 1 { - t.Errorf("excepted create of "+p+" to be called once, got %i", created[p]) + t.Errorf("expected create of "+p+" to be called once, got %i", created[p]) } } } @@ -162,7 +163,7 @@ func TestRunPipelineFailure(t *testing.T) { runPipeline("test/sample_steps_passing.yml", testRunFlags) if len(errors) != 2 { - t.Errorf("excepted two errors, actual %v", len(errors)) + t.Errorf("expected two errors, actual %v", len(errors)) } } @@ -205,7 +206,7 @@ func TestRunPipelineStartTimeout(t *testing.T) { runPipeline("test/sample_steps_passing.yml", &flags) if len(errors) != 2 { - t.Errorf("excepted two errors, actual %v", len(errors)) + t.Errorf("expected two errors, actual %v", len(errors)) } msg := "[paddle] [Timed out waiting for pod to start. Cluster might not have sufficient resources.]" for _, err := range errors { diff --git a/cli/pipeline/template_test.go b/cli/pipeline/template_test.go index 95a495b..1920326 100644 --- a/cli/pipeline/template_test.go +++ b/cli/pipeline/template_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/yaml" ) @@ -13,7 +13,7 @@ func TestCompileTemplate(t *testing.T) { if err != nil { panic(err.Error()) } - pipeline := parsePipeline(data) + pipeline := ParsePipeline(data) podDefinition := NewPodDefinition(pipeline, &pipeline.Steps[0]) @@ -36,7 +36,7 @@ func TestSecrets(t *testing.T) { if err != nil { panic(err.Error()) } - pipeline := parsePipeline(data) + pipeline := ParsePipeline(data) podDefinition := NewPodDefinition(pipeline, &pipeline.Steps[0]) secrets := []string{"ENV_VAR:secret_store:key_name"} @@ -68,7 +68,7 @@ func TestEnv(t *testing.T) { if err != nil { panic(err.Error()) } - pipeline := parsePipeline(data) + pipeline := ParsePipeline(data) podDefinition := NewPodDefinition(pipeline, &pipeline.Steps[0]) env := []string{"ENV_VAR:env_value"}