Skip to content

Commit 676125c

Browse files
pratap0007tekton-robot
authored andcommitted
Fix the Unit tests and update the golden file
- Update the golden file to remove the creationTimestamp: null - Regenerated pkg/cmd/pipeline/testdata/signed.yaml and pkg/cmd/task/testdata/signed.yaml with fresh, valid signatures using the existing keys which was failing earlier - Replaced log.Fatalf() with return fmt.Errorf() for proper error handling Signed-off-by: Shiv Verma <[email protected]>
1 parent 59212d4 commit 676125c

File tree

53 files changed

+18
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+18
-106
lines changed

pkg/actions/list.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ package actions
1616

1717
import (
1818
"context"
19-
"fmt"
2019
"io"
21-
"os"
2220

2321
"github.com/tektoncd/cli/pkg/cli"
2422
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -44,7 +42,6 @@ func PrintObjects(groupResource schema.GroupVersionResource, w io.Writer, dynami
4442
func ListV1(gr schema.GroupVersionResource, c *cli.Clients, opts metav1.ListOptions, ns string, obj interface{}) error {
4543
unstructuredObj, err := list(gr, c.Dynamic, c.Tekton.Discovery(), ns, opts)
4644
if err != nil {
47-
fmt.Fprintf(os.Stderr, "Failed to list objects from %s namespace \n", ns)
4845
return err
4946
}
5047

pkg/cmd/bundle/list_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const (
2020
examplePullTask = `apiVersion: tekton.dev/v1beta1
2121
kind: Task
2222
metadata:
23-
creationTimestamp: null
2423
name: foobar
2524
spec:
2625
params:
@@ -29,7 +28,6 @@ spec:
2928
examplePullPipeline = `apiVersion: tekton.dev/v1beta1
3029
kind: Pipeline
3130
metadata:
32-
creationTimestamp: null
3331
name: foobar
3432
spec:
3533
params:
@@ -48,15 +46,15 @@ func TestListCommand(t *testing.T) {
4846
{
4947
name: "no-format",
5048
format: "",
51-
expectedStdout: "*Warning*: This is an experimental command, its usage and behavior can change in the next release(s)\npipeline.tekton.dev/foobar\ntask.tekton.dev/foobar\n",
49+
expectedStdout: "*Warning*: This is an experimental command, its usage and behavior can change in the next release(s)\ntask.tekton.dev/foobar\npipeline.tekton.dev/foobar\n",
5250
}, {
5351
name: "name-format",
5452
format: "name",
55-
expectedStdout: "*Warning*: This is an experimental command, its usage and behavior can change in the next release(s)\npipeline.tekton.dev/foobar\ntask.tekton.dev/foobar\n",
53+
expectedStdout: "*Warning*: This is an experimental command, its usage and behavior can change in the next release(s)\ntask.tekton.dev/foobar\npipeline.tekton.dev/foobar\n",
5654
}, {
5755
name: "yaml-format",
5856
format: "yaml",
59-
expectedStdout: "*Warning*: This is an experimental command, its usage and behavior can change in the next release(s)\n" + examplePullPipeline + "---\n" + examplePullTask,
57+
expectedStdout: "*Warning*: This is an experimental command, its usage and behavior can change in the next release(s)\n" + examplePullTask + "---\n" + examplePullPipeline,
6058
}, {
6159
name: "specify-kind-task",
6260
format: "name",

pkg/cmd/clustertriggerbinding/testdata/TestClusterTriggerBindingDescribe_WithOutputYaml.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: triggers.tekton.dev/v1beta1
22
kind: ClusterTriggerBinding
33
metadata:
4-
creationTimestamp: null
54
name: ctb1
65
spec:
76
params:

pkg/cmd/eventlistener/testdata/TestEventListenerDescribe_OutputYAMLWithMultipleBindingAndInterceptors.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: triggers.tekton.dev/v1beta1
22
kind: EventListener
33
metadata:
4-
creationTimestamp: null
54
name: el1
65
namespace: ns
76
spec:

pkg/cmd/pipeline/testdata/TestPipelineDescribe_with_spec_multiple_param_run_output.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: tekton.dev/v1
22
kind: pipeline
33
metadata:
4-
creationTimestamp: null
54
name: pipeline
65
namespace: ns
76
spec:

pkg/cmd/pipeline/testdata/TestPipelineDescribe_with_spec_multiple_resource_param_run_output_v1beta1.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: tekton.dev/v1beta1
22
kind: pipeline
33
metadata:
4-
creationTimestamp: null
54
name: pipeline
65
namespace: ns
76
spec:

pkg/cmd/pipeline/testdata/TestPipelineStart_ExecuteCommand-Dry_Run_using_--filename_v1.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: tekton.dev/v1
22
kind: PipelineRun
33
metadata:
4-
creationTimestamp: null
54
generateName: test-pipeline-run-
65
namespace: ns
76
spec:

pkg/cmd/pipeline/testdata/TestPipelineStart_ExecuteCommand-Dry_Run_with_--pipeline-timeout,_--tasks-timeout,_--finally-timeout_specified.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: tekton.dev/v1
22
kind: PipelineRun
33
metadata:
4-
creationTimestamp: null
54
generateName: test-pipeline-run-
65
labels:
76
jemange: desfrites

pkg/cmd/pipeline/testdata/TestPipelineStart_ExecuteCommand-Dry_Run_with_--pipeline-timeout,_--tasks-timeout_specified.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: tekton.dev/v1
22
kind: PipelineRun
33
metadata:
4-
creationTimestamp: null
54
generateName: test-pipeline-run-
65
labels:
76
jemange: desfrites

pkg/cmd/pipeline/testdata/TestPipelineStart_ExecuteCommand-Dry_Run_with_--pipeline-timeout_specified.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: tekton.dev/v1
22
kind: PipelineRun
33
metadata:
4-
creationTimestamp: null
54
generateName: test-pipeline-run-
65
labels:
76
jemange: desfrites

0 commit comments

Comments
 (0)