Skip to content

Commit

Permalink
sigmahq: fix functional test (#3359)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored Dec 10, 2024
1 parent 411bb48 commit 88c5f85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/crowdsec-cli/clihub/items.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func ListItems(out io.Writer, wantColor string, itemTypes []string, items map[st
Name: item.Name,
LocalVersion: item.State.LocalVersion,
LocalPath: item.State.LocalPath,
Description: item.Description,
Description: strings.TrimSpace(item.Description),
Status: status,
UTF8Status: fmt.Sprintf("%v %s", statusEmo, status),
}
Expand Down Expand Up @@ -128,7 +128,7 @@ func ListItems(out io.Writer, wantColor string, itemTypes []string, items map[st
item.Name,
item.State.Text(),
item.State.LocalVersion,
item.Description,
strings.TrimSpace(item.Description),
}
if len(itemTypes) > 1 {
row = append(row, itemType)
Expand Down
3 changes: 2 additions & 1 deletion test/bats/20_hub_scenarios.bats
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ teardown() {
list_human=$(cscli scenarios list -o human -a | tail -n +6 | head -n -1 | cut -d' ' -f2)
list_json=$(cscli scenarios list -o json -a | jq -r '.scenarios[].name')

rune -0 sort -f <<<"$list_raw"
# use python to sort because it handles "_" like go
rune -0 python3 -c 'import sys; print("".join(sorted(sys.stdin.readlines(), key=str.casefold)), end="")' <<<"$list_raw"
assert_output "$list_raw"

assert_equal "$list_raw" "$list_json"
Expand Down

0 comments on commit 88c5f85

Please sign in to comment.