2019-02-10 19:00:16 +00:00
|
|
|
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
2019-02-21 20:48:45 +00:00
|
|
|
// Use of this source code is governed by the Drone Non-Commercial License
|
|
|
|
// that can be found in the LICENSE file.
|
2019-02-10 19:00:16 +00:00
|
|
|
|
2019-01-22 23:44:17 +00:00
|
|
|
package pretty
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestPipeline_Build_Short(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_build_short.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Build_Long(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_build_long.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Concurrency(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_concurrency.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Clone_Depth(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_clone_depth.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Clone_Disable(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_clone_disable.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Clone_SkipVerify(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_clone_skip_verify.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Depends(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_depends.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Node(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_node.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Push(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_push.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Ports(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_ports.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Resources(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_resources.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Services(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/services.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Settings(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_settings.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Trigger(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_trigger.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Volumes(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_volumes.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPipeline_Workspace(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_workspace.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|
2019-02-22 01:10:27 +00:00
|
|
|
|
|
|
|
func TestPipeline_ImagePullSecrets(t *testing.T) {
|
|
|
|
ok, err := diff("testdata/pipeline_image_pull_secrets.yml")
|
|
|
|
if err != nil {
|
|
|
|
t.Error(err)
|
|
|
|
} else if !ok {
|
|
|
|
t.Errorf("Unepxected formatting")
|
|
|
|
}
|
|
|
|
}
|