Skip to content

Commit 2ea77f6

Browse files
dploegerDennis Ploeger
authored andcommitted
fix: Fixed test runner not ignoring .-directories
1 parent 6423833 commit 2ea77f6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cmd/tests/test-features.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func getFeatures(flavour string) []lib.Feature {
7777
funk.FilterString(
7878
featuresGlob,
7979
func(value string) bool {
80-
if correctPathRegexp.Match([]byte(value)) {
80+
if correctPathRegexp.Match([]byte(filepath.Base(value))) {
8181
if yamlFile, err := os.ReadFile(filepath.Join(value, "feature.yaml")); err != nil {
8282
return false
8383
} else {
@@ -225,8 +225,10 @@ func main() {
225225
os.Exit(1)
226226
}
227227

228+
features := getFeatures(*flavour)
229+
228230
for _, includeFeature := range *includeFeatures {
229-
if !funk.Contains(getFeatures(*flavour), func(feature lib.Feature) bool {
231+
if !funk.Contains(features, func(feature lib.Feature) bool {
230232
return feature.Name == includeFeature
231233
}) {
232234
logrus.Errorf("%s is not a known feature", includeFeature)
@@ -236,7 +238,7 @@ func main() {
236238
}
237239

238240
for _, excludeFeature := range *excludeFeatures {
239-
if !funk.Contains(getFeatures(*flavour), func(feature lib.Feature) bool {
241+
if !funk.Contains(features, func(feature lib.Feature) bool {
240242
return feature.Name == excludeFeature
241243
}) {
242244
logrus.Errorf("%s is not a known feature", excludeFeature)

0 commit comments

Comments
 (0)