@@ -138,6 +138,22 @@ key2: value2
138
138
require .Exactly (t , expectedOutputRows , output .Tables [0 ].Rows )
139
139
})
140
140
141
+ logger .Section ("package installed list with one package installed with wide option" , func () {
142
+ out , err := kappCtrl .RunWithOpts ([]string {"package" , "installed" , "list" , "--wide" , "--json" }, RunOpts {})
143
+ require .NoError (t , err )
144
+
145
+ output := uitest .JSONUIFromBytes (t , []byte (out ))
146
+
147
+ expectedOutputRows := []map [string ]string {{
148
+ "message" : "" ,
149
+ "name" : "testpkgi" ,
150
+ "package_name" : "test-pkg.carvel.dev" ,
151
+ "package_version" : "1.0.0" ,
152
+ "status" : "Reconcile succeeded" ,
153
+ }}
154
+ require .Exactly (t , expectedOutputRows , output .Tables [0 ].Rows )
155
+ })
156
+
141
157
logger .Section ("package installed get" , func () {
142
158
143
159
out , err := kappCtrl .RunWithOpts ([]string {"package" , "installed" , "get" , "--package-install" , pkgiName , "--json" }, RunOpts {})
@@ -260,6 +276,36 @@ key2: value2
260
276
require .Contains (t , err .Error (), "not found" )
261
277
})
262
278
279
+ logger .Section ("Listing with error in package install" , func () {
280
+ incorrectValuesFile := `
281
+ key1: value1:
282
+ `
283
+ _ , err := kappCtrl .RunWithOpts ([]string {"package" , "installed" , "create" , "--package-install" , pkgiName ,
284
+ "-p" , packageMetadataName , "--version" , packageVersion1 ,
285
+ "--values-file" , "-" }, RunOpts {
286
+ StdinReader : strings .NewReader (incorrectValuesFile ),
287
+ AllowError : true ,
288
+ })
289
+ require .Error (t , err )
290
+
291
+ out , err := kappCtrl .RunWithOpts ([]string {"package" , "installed" , "list" , "--wide" , "--json" }, RunOpts {})
292
+ require .NoError (t , err )
293
+
294
+ output := uitest .JSONUIFromBytes (t , []byte (out ))
295
+
296
+ expectedOutputRows := []map [string ]string {{
297
+ "message" : "Error (see .status.usefulErrorMessage for details)" ,
298
+ "name" : "testpkgi" ,
299
+ "package_name" : "test-pkg.carvel.dev" ,
300
+ "package_version" : "1.0.0" ,
301
+ "status" : "Reconcile failed" ,
302
+ }}
303
+ require .Exactly (t , expectedOutputRows , output .Tables [0 ].Rows )
304
+
305
+ _ , err = kappCtrl .RunWithOpts ([]string {"package" , "installed" , "delete" , "--package-install" , pkgiName }, RunOpts {})
306
+ require .NoError (t , err )
307
+ })
308
+
263
309
logger .Section ("package installed update with missing old version" , func () {
264
310
kappCtrl .RunWithOpts ([]string {"package" , "installed" , "create" , "--package-install" , pkgiName ,
265
311
"-p" , packageMetadataName , "--version" , packageVersion1 ,
0 commit comments