Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2240 from paco-valverde/scout-command-metrics
Browse files Browse the repository at this point in the history
metrics: scout command usage
  • Loading branch information
glours authored Apr 13, 2023
2 parents 731d87b + 9755173 commit 9ef8fac
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/metrics/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var managementCommands = []string{
"plugin",
"sbom",
"scan",
"scout",
"secret",
"service",
"signer",
Expand Down Expand Up @@ -77,6 +78,7 @@ var commands = []string{
"convert",
"cp",
"create",
"cves",
"debug",
"demote",
"deploy",
Expand Down
26 changes: 26 additions & 0 deletions cli/metrics/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,29 @@ func TestBuild(t *testing.T) {
})
}
}

func TestScout(t *testing.T) {
testCases := []struct {
name string
args []string
expected string
}{
{
name: "scout",
args: []string{"scout"},
expected: "scout",
},
{
name: "scout - cves ",
args: []string{"scout", "cves", "alpine"},
expected: "scout cves",
},
}

for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
result := GetCommand(testCase.args)
assert.Equal(t, testCase.expected, result)
})
}
}

0 comments on commit 9ef8fac

Please sign in to comment.