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

Commit 9ef8fac

Browse files
authored
Merge pull request #2240 from paco-valverde/scout-command-metrics
metrics: scout command usage
2 parents 731d87b + 9755173 commit 9ef8fac

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

cli/metrics/commands.go

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ var managementCommands = []string{
4949
"plugin",
5050
"sbom",
5151
"scan",
52+
"scout",
5253
"secret",
5354
"service",
5455
"signer",
@@ -77,6 +78,7 @@ var commands = []string{
7778
"convert",
7879
"cp",
7980
"create",
81+
"cves",
8082
"debug",
8183
"demote",
8284
"deploy",

cli/metrics/metrics_test.go

+26
Original file line numberDiff line numberDiff line change
@@ -386,3 +386,29 @@ func TestBuild(t *testing.T) {
386386
})
387387
}
388388
}
389+
390+
func TestScout(t *testing.T) {
391+
testCases := []struct {
392+
name string
393+
args []string
394+
expected string
395+
}{
396+
{
397+
name: "scout",
398+
args: []string{"scout"},
399+
expected: "scout",
400+
},
401+
{
402+
name: "scout - cves ",
403+
args: []string{"scout", "cves", "alpine"},
404+
expected: "scout cves",
405+
},
406+
}
407+
408+
for _, testCase := range testCases {
409+
t.Run(testCase.name, func(t *testing.T) {
410+
result := GetCommand(testCase.args)
411+
assert.Equal(t, testCase.expected, result)
412+
})
413+
}
414+
}

0 commit comments

Comments
 (0)