@@ -45,7 +45,11 @@ func (g fakeGit) ListChangedFilesInDirs(commit string, dirs ...string) ([]string
45
45
"test_charts/foo/Chart.yaml" ,
46
46
"test_charts/bar/Chart.yaml" ,
47
47
"test_charts/bar/bar_sub/templates/bar_sub.yaml" ,
48
+ "test_charts/excluded/Chart.yaml" ,
48
49
"test_chart_at_root/templates/foo.yaml" ,
50
+ "test_chart_at_multi_level/foo/bar/Chart.yaml" ,
51
+ "test_chart_at_multi_level/foo/baz/Chart.yaml" ,
52
+ "test_chart_at_multi_level/foo/excluded/Chart.yaml" ,
49
53
"some_non_chart_dir/some_non_chart_file" ,
50
54
"some_non_chart_file" ,
51
55
}, nil
@@ -152,6 +156,21 @@ func TestComputeChangedChartDirectories(t *testing.T) {
152
156
assert .Nil (t , err )
153
157
}
154
158
159
+ func TestComputeChangedChartDirectoriesWithMultiLevelChart (t * testing.T ) {
160
+ cfg := config.Configuration {
161
+ ExcludedCharts : []string {"excluded" },
162
+ ChartDirs : []string {"test_chart_at_multi_level/foo" },
163
+ }
164
+ ct := newTestingMock (cfg )
165
+ actual , err := ct .ComputeChangedChartDirectories ()
166
+ expected := []string {"test_chart_at_multi_level/foo/bar" , "test_chart_at_multi_level/foo/baz" }
167
+ for _ , chart := range actual {
168
+ assert .Contains (t , expected , chart )
169
+ }
170
+ assert .Len (t , actual , 2 )
171
+ assert .Nil (t , err )
172
+ }
173
+
155
174
func TestReadAllChartDirectories (t * testing.T ) {
156
175
actual , err := ct .ReadAllChartDirectories ()
157
176
expected := []string {
0 commit comments