@@ -67,15 +67,7 @@ func Test_buildSetOfPRNumbers(t *testing.T) {
6767}
6868
6969func Test_githubFromToPRLister_listPRs (t * testing.T ) {
70- type fields struct {
71- client * githubClient
72- fromRef * ref
73- toRef * ref
74- branch string
75- }
76- type args struct {
77- previousReleaseRef ref
78- }
70+
7971 tests := []struct {
8072 name string
8173 fields * githubFromToPRLister
@@ -85,106 +77,106 @@ func Test_githubFromToPRLister_listPRs(t *testing.T) {
8577 {
8678 name : "Successful PR Listing" ,
8779 fields : & githubFromToPRLister {
88- client : & githubClient {
89- repo : "kubernetes-sigs/kind" ,
80+ client : & githubClient {
81+ repo : "kubernetes-sigs/kind" ,
9082 },
9183 fromRef : ref {
9284 reType : "tags" ,
93- value : "v0.26.0" ,
85+ value : "v0.26.0" ,
9486 },
9587 toRef : ref {
9688 reType : "tags" ,
97- value : "v0.27.0" ,
89+ value : "v0.27.0" ,
9890 },
99- branch : "main" ,
91+ branch : "main" ,
10092 },
10193 args : ref {
10294 reType : "tags" ,
103- value : "v0.26.0" ,
95+ value : "v0.26.0" ,
10496 },
10597 wantErr : false ,
10698 },
10799 {
108100 name : "Setting previousReleaseRef.value blank - should use toRef and fromRef from fields" ,
109101 fields : & githubFromToPRLister {
110- client : & githubClient {
111- repo : "kubernetes-sigs/kind" ,
102+ client : & githubClient {
103+ repo : "kubernetes-sigs/kind" ,
112104 },
113105 fromRef : ref {
114106 reType : "tags" ,
115- value : "v0.26.0" ,
107+ value : "v0.26.0" ,
116108 },
117109 toRef : ref {
118110 reType : "tags" ,
119- value : "v0.27.0" ,
111+ value : "v0.27.0" ,
120112 },
121- branch : "main" ,
113+ branch : "main" ,
122114 },
123115 args : ref {
124116 reType : "tags" ,
125- value : "" ,
117+ value : "" ,
126118 },
127119 wantErr : false ,
128120 },
129121 {
130122 name : "Create PR List when fromRef is not set" ,
131123 fields : & githubFromToPRLister {
132- client : & githubClient {
133- repo : "kubernetes-sigs/kind" ,
124+ client : & githubClient {
125+ repo : "kubernetes-sigs/kind" ,
134126 },
135127 toRef : ref {
136128 reType : "tags" ,
137- value : "v0.27.0" ,
129+ value : "v0.27.0" ,
138130 },
139- branch : "main" ,
131+ branch : "main" ,
140132 },
141133 args : ref {
142134 reType : "tags" ,
143- value : "v0.26.0" ,
135+ value : "v0.26.0" ,
144136 },
145137 wantErr : false ,
146138 },
147139 {
148140 name : "Fail when previousReleaseRef.value is set to invalid" ,
149141 fields : & githubFromToPRLister {
150- client : & githubClient {
151- repo : "kubernetes-sigs/kind" ,
142+ client : & githubClient {
143+ repo : "kubernetes-sigs/kind" ,
152144 },
153145 fromRef : ref {
154146 reType : "tags" ,
155- value : "v0.26.0" ,
147+ value : "v0.26.0" ,
156148 },
157149 toRef : ref {
158150 reType : "tags" ,
159- value : "v0.27.0" ,
151+ value : "v0.27.0" ,
160152 },
161- branch : "main" ,
153+ branch : "main" ,
162154 },
163155 args : ref {
164156 reType : "tags" ,
165- value : "invalid" ,
157+ value : "invalid" ,
166158 },
167159 wantErr : true ,
168160 },
169161 {
170162 name : "Fail when toRef and previousReleaseRef set blank" ,
171163 fields : & githubFromToPRLister {
172- client : & githubClient {
173- repo : "kubernetes-sigs/kind" ,
164+ client : & githubClient {
165+ repo : "kubernetes-sigs/kind" ,
174166 },
175167 fromRef : ref {
176168 reType : "tags" ,
177- value : "v0.26.0" ,
169+ value : "v0.26.0" ,
178170 },
179171 toRef : ref {
180172 reType : "tags" ,
181- value : "" ,
173+ value : "" ,
182174 },
183- branch : "main" ,
175+ branch : "main" ,
184176 },
185177 args : ref {
186178 reType : "tags" ,
187- value : "" ,
179+ value : "" ,
188180 },
189181 wantErr : true ,
190182 },
0 commit comments