-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will refactor the listing of pipeline resource in `tkn res list` and `tkn task describe taskname` and `tkn pipeline describe pipelinename` commands. Now it will show the resources sorted by type and then further sorted by name Refactor tests accordingly
- Loading branch information
1 parent
aea0869
commit 5ec20b2
Showing
7 changed files
with
173 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,11 @@ import ( | |
func TestPipelineResourceList(t *testing.T) { | ||
|
||
pres := []*v1alpha1.PipelineResource{ | ||
tb.PipelineResource("test", "test-ns-1", | ||
tb.PipelineResourceSpec("git", | ||
tb.PipelineResourceSpecParam("url", "[email protected]:tektoncd/cli-new.git"), | ||
), | ||
), | ||
tb.PipelineResource("test-1", "test-ns-1", | ||
tb.PipelineResourceSpec("image", | ||
tb.PipelineResourceSpecParam("URL", "quey.io/tekton/controller"), | ||
|
@@ -60,8 +65,9 @@ func TestPipelineResourceList(t *testing.T) { | |
args: []string{"list", "-n", "test-ns-1"}, | ||
expected: []string{ | ||
"NAME TYPE DETAILS", | ||
"test-1 image URL: quey.io/tekton/controller", | ||
"test git url: [email protected]:tektoncd/cli-new.git", | ||
"test-2 git url: [email protected]:tektoncd/cli.git", | ||
"test-1 image URL: quey.io/tekton/controller", | ||
"test-3 image ---", | ||
"", | ||
}, | ||
|
@@ -79,10 +85,10 @@ func TestPipelineResourceList(t *testing.T) { | |
{ | ||
name: "Single Pipeline Resource by type", | ||
command: command(t, pres), | ||
args: []string{"list", "-n", "test-ns-1", "-t", "git"}, | ||
args: []string{"list", "-n", "test-ns-2", "-t", "image"}, | ||
expected: []string{ | ||
"NAME TYPE DETAILS", | ||
"test-2 git url: [email protected]:tektoncd/cli.git", | ||
"NAME TYPE DETAILS", | ||
"test-4 image URL: quey.io/tekton/webhook", | ||
"", | ||
}, | ||
}, | ||
|
@@ -111,8 +117,9 @@ func TestPipelineResourceList(t *testing.T) { | |
command: command(t, pres), | ||
args: []string{"list", "-n", "test-ns-1", "-o", "jsonpath={range .items[*]}{.metadata.name}{\"\\n\"}{end}"}, | ||
expected: []string{ | ||
"test-1", | ||
"test", | ||
"test-2", | ||
"test-1", | ||
"test-3", | ||
"", | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters