@@ -318,15 +318,23 @@ func (t *Testing) processCharts(action func(chart *Chart) TestResult) ([]TestRes
318
318
}
319
319
}
320
320
321
- fmt .Println ()
322
- util .PrintDelimiterLineToWriter (os .Stdout , "-" )
323
- fmt .Println (" Charts to be processed:" )
324
- util .PrintDelimiterLineToWriter (os .Stdout , "-" )
321
+ if ! t .config .GithubGroups {
322
+ fmt .Println ()
323
+ util .PrintDelimiterLineToWriter (os .Stdout , "-" )
324
+ fmt .Println (" Charts to be processed:" )
325
+ util .PrintDelimiterLineToWriter (os .Stdout , "-" )
326
+ } else {
327
+ util .GithubGroupsBegin (os .Stdout , "Charts to be processed" )
328
+ }
325
329
for _ , chart := range charts {
326
330
fmt .Printf (" %s\n " , chart )
327
331
}
328
- util .PrintDelimiterLineToWriter (os .Stdout , "-" )
329
- fmt .Println ()
332
+ if ! t .config .GithubGroups {
333
+ util .PrintDelimiterLineToWriter (os .Stdout , "-" )
334
+ fmt .Println ()
335
+ } else {
336
+ util .GithubGroupsEnd (os .Stdout )
337
+ }
330
338
331
339
repoArgs := map [string ][]string {}
332
340
@@ -414,7 +422,12 @@ func (t *Testing) LintAndInstallCharts() ([]TestResult, error) {
414
422
415
423
// PrintResults writes test results to stdout.
416
424
func (t * Testing ) PrintResults (results []TestResult ) {
417
- util .PrintDelimiterLineToWriter (os .Stdout , "-" )
425
+ if ! t .config .GithubGroups {
426
+ fmt .Println ()
427
+ util .PrintDelimiterLineToWriter (os .Stdout , "-" )
428
+ } else {
429
+ util .GithubGroupsBegin (os .Stdout , "Test Results" )
430
+ }
418
431
if results != nil {
419
432
for _ , result := range results {
420
433
err := result .Error
@@ -427,7 +440,11 @@ func (t *Testing) PrintResults(results []TestResult) {
427
440
} else {
428
441
fmt .Println ("No chart changes detected." )
429
442
}
430
- util .PrintDelimiterLineToWriter (os .Stdout , "-" )
443
+ if ! t .config .GithubGroups {
444
+ util .PrintDelimiterLineToWriter (os .Stdout , "-" )
445
+ } else {
446
+ util .GithubGroupsEnd (os .Stdout )
447
+ }
431
448
}
432
449
433
450
// LintChart lints the specified chart.
@@ -882,7 +899,7 @@ func (t *Testing) ValidateMaintainers(chart *Chart) error {
882
899
func (t * Testing ) PrintEventsPodDetailsAndLogs (namespace string , selector string ) {
883
900
util .PrintDelimiterLineToWriter (os .Stdout , "=" )
884
901
885
- printDetails (namespace , "Events of namespace" , "." , func (item string ) error {
902
+ t . printDetails (namespace , "Events of namespace" , "." , func (item string ) error {
886
903
return t .kubectl .GetEvents (namespace )
887
904
}, namespace )
888
905
@@ -901,7 +918,7 @@ func (t *Testing) PrintEventsPodDetailsAndLogs(namespace string, selector string
901
918
}
902
919
903
920
for _ , pod := range pods {
904
- printDetails (pod , "Description of pod" , "~" , func (item string ) error {
921
+ t . printDetails (pod , "Description of pod" , "~" , func (item string ) error {
905
922
return t .kubectl .DescribePod (namespace , pod )
906
923
}, pod )
907
924
@@ -912,7 +929,7 @@ func (t *Testing) PrintEventsPodDetailsAndLogs(namespace string, selector string
912
929
}
913
930
914
931
if t .config .PrintLogs {
915
- printDetails (pod , "Logs of init container" , "-" ,
932
+ t . printDetails (pod , "Logs of init container" , "-" ,
916
933
func (item string ) error {
917
934
return t .kubectl .Logs (namespace , pod , item )
918
935
}, initContainers ... )
@@ -923,7 +940,7 @@ func (t *Testing) PrintEventsPodDetailsAndLogs(namespace string, selector string
923
940
return
924
941
}
925
942
926
- printDetails (pod , "Logs of container" , "-" ,
943
+ t . printDetails (pod , "Logs of container" , "-" ,
927
944
func (item string ) error {
928
945
return t .kubectl .Logs (namespace , pod , item )
929
946
},
@@ -934,21 +951,29 @@ func (t *Testing) PrintEventsPodDetailsAndLogs(namespace string, selector string
934
951
util .PrintDelimiterLineToWriter (os .Stdout , "=" )
935
952
}
936
953
937
- func printDetails (resource string , text string , delimiterChar string , printFunc func (item string ) error , items ... string ) {
954
+ func ( t * Testing ) printDetails (resource string , text string , delimiterChar string , printFunc func (item string ) error , items ... string ) {
938
955
for _ , item := range items {
939
956
item = strings .Trim (item , "'" )
940
957
941
- util .PrintDelimiterLineToWriter (os .Stdout , delimiterChar )
942
- fmt .Printf ("==> %s %s\n " , text , resource )
943
- util .PrintDelimiterLineToWriter (os .Stdout , delimiterChar )
958
+ if ! t .config .GithubGroups {
959
+ util .PrintDelimiterLineToWriter (os .Stdout , delimiterChar )
960
+ fmt .Printf ("==> %s %s\n " , text , resource )
961
+ util .PrintDelimiterLineToWriter (os .Stdout , delimiterChar )
962
+ } else {
963
+ util .GithubGroupsBegin (os .Stdout , fmt .Sprintf ("%s %s" , text , resource ))
964
+ }
944
965
945
966
if err := printFunc (item ); err != nil {
946
967
fmt .Println ("Error printing details:" , err )
947
968
return
948
969
}
949
970
950
- util .PrintDelimiterLineToWriter (os .Stdout , delimiterChar )
951
- fmt .Printf ("<== %s %s\n " , text , resource )
952
- util .PrintDelimiterLineToWriter (os .Stdout , delimiterChar )
971
+ if ! t .config .GithubGroups {
972
+ util .PrintDelimiterLineToWriter (os .Stdout , delimiterChar )
973
+ fmt .Printf ("<== %s %s\n " , text , resource )
974
+ util .PrintDelimiterLineToWriter (os .Stdout , delimiterChar )
975
+ } else {
976
+ util .GithubGroupsEnd (os .Stdout )
977
+ }
953
978
}
954
979
}
0 commit comments