Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions mantle/kola/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,13 @@ func testRequiresInternet(test *register.Test) bool {
}

type DenyListObj struct {
Pattern string `yaml:"pattern"`
Tracker string `yaml:"tracker"`
Streams []string `yaml:"streams"`
Arches []string `yaml:"arches"`
Platforms []string `yaml:"platforms"`
SnoozeDate string `yaml:"snooze"`
Pattern string `yaml:"pattern"`
Tracker string `yaml:"tracker"`
TrackerList []string `yaml:"tracker_list"`
Comment on lines +281 to +282

@saqibali-2k saqibali-2k Aug 3, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tracker string `yaml:"tracker"`
TrackerList []string `yaml:"tracker_list"`
Tracker []string `yaml:"tracker"`

I think we can change Tracker to []string from string rather than adding a TrackerList which seems to be closer to the assumed functionality in the linked PRs. If we prefer to have a separate field, that works too!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the wholesale change from string to []string, but the YAML module is strict about the type (well, all of Golang is strictly typed...) so it blows up trying to unmarhsal the data:

cannot unmarshal !!seq into main.DenyListObj

See this example snippet I was playing with - https://play.golang.org/p/WxafbrQGuNe

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep you're right that functionality isn't present, ignore the above suggestion.

Streams []string `yaml:"streams"`
Arches []string `yaml:"arches"`
Platforms []string `yaml:"platforms"`
SnoozeDate string `yaml:"snooze"`
}

type ManifestData struct {
Expand Down Expand Up @@ -358,7 +359,13 @@ func parseDenyListYaml(pltfrm string) error {
fmt.Printf("⚠️ Skipping kola test pattern \"%s\":\n", obj.Pattern)
}

fmt.Printf(" 👉 %s\n", obj.Tracker)
if obj.Tracker != "" {
fmt.Printf(" 👉 %s\n", obj.Tracker)
} else if len(obj.TrackerList) > 0 {
for _, tracker := range obj.TrackerList {
fmt.Printf(" 👉 %s\n", tracker)
}
}
DenylistedTests = append(DenylistedTests, obj.Pattern)
}

Expand Down