Skip to content

Commit 8b26c72

Browse files
danruemwasilew
authored andcommitted
skipgen: Change default behavior to show all skips
When running skipgen against a yaml skipfile with no additional arguments, return all of the skips. Additional arguments (board/environment/branch) can be used to narrow down the list. The previous behavior would only show skips that are "all/all/all" when run with no arguments, and then more skips would be returned as board/environment/branch was added. Signed-off-by: Dan Rue <dan.rue@linaro.org>
1 parent 8efa159 commit 8b26c72

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ help:
99
@echo " test"
1010
@echo " clean"
1111

12-
$(FILE): test
12+
$(FILE): test skipgen.go
1313
go build
1414

1515
test:

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ binary.
1717

1818
## Example Usage
1919

20+
Show all skips available:
21+
2022
$ skipgen examples/skipfile.yaml
21-
seccomp_bpf
22-
$ skipgen --board x15 --environment production --branch=4.4 examples/skipfile.yaml
2323
test_verifier
2424
test_tag
2525
test_maps
@@ -29,6 +29,12 @@ binary.
2929
test_align
3030
...
3131

32+
Show skips that apply to the x15 board in the production environment and branch 4.4:
33+
34+
./skipgen --board=x15 --environment=staging --branch=4.4 examples/skipfile.yaml
35+
run_vmtests
36+
seccomp_bpf
37+
3238
## Skipfile Format
3339

3440
See [examples/skipfile.yaml](examples/skipfile.yaml).

examples/skipfile.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ skiplist:
33
url: https://projects.linaro.org/projects/CTT/queues/issue/CTT-585
44
environments:
55
- production
6-
- staging
76
boards:
87
- all
98
branches:

skipgen.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ func (a *StringArray) UnmarshalYAML(unmarshal func(interface{}) error) error {
4646
// in a slice of strings. If "all" is contained in
4747
// the slice, then true is always returned.
4848
func stringInSlice(a string, list []string) bool {
49+
if a == "all" {
50+
return true
51+
}
4952
for _, b := range list {
5053
if b == a || b == "all" {
5154
return true
@@ -98,9 +101,9 @@ func usage() {
98101

99102
func main() {
100103

101-
boardPtr := flag.String("board", "all", "Board name. If not specified, skips that apply to all boards will be returned.")
102-
branchPtr := flag.String("branch", "all", "Branch name. If not specified, skips that apply to all branches will be returned.")
103-
environmentPtr := flag.String("environment", "all", "Environment name. If not specified, skips that apply to all environments will be returned.")
104+
boardPtr := flag.String("board", "all", "Board name. If not specified, skips for all boards will be returned.")
105+
branchPtr := flag.String("branch", "all", "Branch name. If not specified, skips for all branches will be returned.")
106+
environmentPtr := flag.String("environment", "all", "Environment name. If not specified, skips for all environments will be returned.")
104107
versionPtr := flag.Bool("version", false, "Print skipgen version and exit.")
105108
flag.Parse()
106109

0 commit comments

Comments
 (0)