@@ -667,8 +667,8 @@ func TestManifestActions(t *testing.T) {
667
667
wantErr bool
668
668
}
669
669
670
- testCases := [ ]TestCase {
671
- {
670
+ testCases := map [ string ]TestCase {
671
+ "root manifest without transitive actions" : {
672
672
fs : map [string ]mockFsEntry {
673
673
"action.yml" : {
674
674
Content : []byte (manifestWithNoSteps ),
@@ -677,7 +677,7 @@ func TestManifestActions(t *testing.T) {
677
677
path : "" ,
678
678
wantErr : false ,
679
679
},
680
- {
680
+ "root manifest with transitive actions" : {
681
681
fs : map [string ]mockFsEntry {
682
682
"action.yml" : {
683
683
Content : []byte (manifestWithStep ),
@@ -686,7 +686,7 @@ func TestManifestActions(t *testing.T) {
686
686
path : "" ,
687
687
wantErr : false ,
688
688
},
689
- {
689
+ "root manifest using nested actions" : {
690
690
fs : map [string ]mockFsEntry {
691
691
"action.yml" : {
692
692
Content : []byte (manifestWithNestedActions ),
@@ -695,7 +695,7 @@ func TestManifestActions(t *testing.T) {
695
695
path : "" ,
696
696
wantErr : false ,
697
697
},
698
- {
698
+ "nested .yml manifest" : {
699
699
fs : map [string ]mockFsEntry {
700
700
"nested" : {
701
701
Dir : true ,
@@ -709,7 +709,7 @@ func TestManifestActions(t *testing.T) {
709
709
path : "nested" ,
710
710
wantErr : false ,
711
711
},
712
- {
712
+ "root .yaml manifest" : {
713
713
fs : map [string ]mockFsEntry {
714
714
"action.yaml" : {
715
715
Content : []byte (manifestWithStep ),
@@ -718,7 +718,7 @@ func TestManifestActions(t *testing.T) {
718
718
path : "" ,
719
719
wantErr : false ,
720
720
},
721
- {
721
+ "nested .yaml manifest" : {
722
722
fs : map [string ]mockFsEntry {
723
723
"nested" : {
724
724
Dir : true ,
@@ -732,7 +732,30 @@ func TestManifestActions(t *testing.T) {
732
732
path : "nested" ,
733
733
wantErr : false ,
734
734
},
735
- {
735
+ "root Dockerfile manifest" : {
736
+ fs : map [string ]mockFsEntry {
737
+ "Dockerfile" : {
738
+ Content : []byte (manifestDockerfile ),
739
+ },
740
+ },
741
+ path : "" ,
742
+ wantErr : false ,
743
+ },
744
+ "nested Dockerfile manifest" : {
745
+ fs : map [string ]mockFsEntry {
746
+ "nested" : {
747
+ Dir : true ,
748
+ Children : map [string ]mockFsEntry {
749
+ "Dockerfile" : {
750
+ Content : []byte (manifestDockerfile ),
751
+ },
752
+ },
753
+ },
754
+ },
755
+ path : "nested" ,
756
+ wantErr : false ,
757
+ },
758
+ "manifest with syntax error" : {
736
759
fs : map [string ]mockFsEntry {
737
760
"action.yml" : {
738
761
Content : []byte (yamlWithSyntaxError ),
@@ -741,7 +764,7 @@ func TestManifestActions(t *testing.T) {
741
764
path : "" ,
742
765
wantErr : true ,
743
766
},
744
- {
767
+ "manifest with invalid uses value" : {
745
768
fs : map [string ]mockFsEntry {
746
769
"action.yml" : {
747
770
Content : []byte (manifestWithInvalidUses ),
@@ -750,15 +773,15 @@ func TestManifestActions(t *testing.T) {
750
773
path : "" ,
751
774
wantErr : true ,
752
775
},
753
- {
776
+ "empty repo" : {
754
777
fs : map [string ]mockFsEntry {},
755
778
path : "" ,
756
779
wantErr : true ,
757
780
},
758
781
}
759
782
760
- for i , tt := range testCases {
761
- t .Run (fmt . Sprintf ( "#%d" , i ) , func (t * testing.T ) {
783
+ for name , tt := range testCases {
784
+ t .Run (name , func (t * testing.T ) {
762
785
t .Parallel ()
763
786
764
787
repo , err := mockRepo (tt .fs )
0 commit comments