Skip to content

Commit

Permalink
Remove Test Builders from remote_tests.go
Browse files Browse the repository at this point in the history
It is better to have simple tests with full objects than test builders as of Issue #3178. Since, they are easier to maintain and are easier to read.
  • Loading branch information
popcor255 authored and tekton-robot committed Mar 3, 2021
1 parent ca26ea8 commit 90bbe04
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ import (
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/registry"
"github.com/google/go-containerregistry/pkg/v1/remote"
tb "github.com/tektoncd/pipeline/internal/builder/v1beta1"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
tkremote "github.com/tektoncd/pipeline/pkg/remote/oci"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestCreateImage(t *testing.T) {
Expand All @@ -39,7 +40,15 @@ func TestCreateImage(t *testing.T) {
defer s.Close()
u, _ := url.Parse(s.URL)

task := tb.Task("test-create-image", tb.TaskType)
task := &v1beta1.Task{
ObjectMeta: metav1.ObjectMeta{
Name: "test-create-image",
},
TypeMeta: metav1.TypeMeta{
APIVersion: "tekton.dev/v1beta1",
Kind: "Task",
},
}

ref, err := CreateImage(u.Host+"/task/test-create-image", task)
if err != nil {
Expand Down

0 comments on commit 90bbe04

Please sign in to comment.