aquaproj / aqua

Declarative CLI Version manager written in Go. Support Lazy Install, Registry, and continuous update with Renovate. CLI version is switched seamlessly
https://aquaproj.github.io
863 stars 39 forks source link

Add unit tests #2352

Open suzuki-shunsuke opened 1 year ago

suzuki-shunsuke commented 1 year ago
$ cmdx t
+ go test ./... -race -covermode=atomic
?       github.com/aquaproj/aqua/v2/cmd/aqua    [no test files]
?       github.com/aquaproj/aqua/v2/cmd/gen-jsonschema  [no test files]
?       github.com/aquaproj/aqua/v2/pkg/cargo   [no test files]
?       github.com/aquaproj/aqua/v2/pkg/cli [no test files]
ok      github.com/aquaproj/aqua/v2/pkg/asset   (cached)    coverage: 34.6% of statements
ok      github.com/aquaproj/aqua/v2/pkg/checksum    (cached)    coverage: 45.6% of statements
ok      github.com/aquaproj/aqua/v2/pkg/config  (cached)    coverage: 47.9% of statements
ok      github.com/aquaproj/aqua/v2/pkg/config/aqua (cached)    coverage: 79.8% of statements
ok      github.com/aquaproj/aqua/v2/pkg/config/registry (cached)    coverage: 40.0% of statements
ok      github.com/aquaproj/aqua/v2/pkg/config-finder   (cached)    coverage: 96.7% of statements
?       github.com/aquaproj/aqua/v2/pkg/controller  [no test files]
?       github.com/aquaproj/aqua/v2/pkg/controller/allowpolicy  [no test files]
ok      github.com/aquaproj/aqua/v2/pkg/config-reader   (cached)    coverage: 78.4% of statements
?       github.com/aquaproj/aqua/v2/pkg/controller/denypolicy   [no test files]
ok      github.com/aquaproj/aqua/v2/pkg/controller/cp   (cached)    coverage: 72.0% of statements
ok      github.com/aquaproj/aqua/v2/pkg/controller/exec (cached)    coverage: 53.2% of statements
?       github.com/aquaproj/aqua/v2/pkg/controller/generate/output  [no test files]
?       github.com/aquaproj/aqua/v2/pkg/controller/info [no test files]
?       github.com/aquaproj/aqua/v2/pkg/controller/updateaqua   [no test files]
?       github.com/aquaproj/aqua/v2/pkg/errors  [no test files]
ok      github.com/aquaproj/aqua/v2/pkg/controller/generate 1.436s  coverage: 67.6% of statements
ok      github.com/aquaproj/aqua/v2/pkg/controller/generate-registry    1.645s  coverage: 36.5% of statements
ok      github.com/aquaproj/aqua/v2/pkg/controller/initcmd  1.251s  coverage: 82.4% of statements
ok      github.com/aquaproj/aqua/v2/pkg/controller/initpolicy   (cached)    coverage: 88.9% of statements
ok      github.com/aquaproj/aqua/v2/pkg/controller/install  (cached)    coverage: 47.4% of statements
ok      github.com/aquaproj/aqua/v2/pkg/controller/list (cached)    coverage: 50.0% of statements
ok      github.com/aquaproj/aqua/v2/pkg/controller/remove   (cached)    coverage: 4.9% of statements
?       github.com/aquaproj/aqua/v2/pkg/link    [no test files]
?       github.com/aquaproj/aqua/v2/pkg/ptr [no test files]
ok      github.com/aquaproj/aqua/v2/pkg/controller/update   1.242s  coverage: 72.7% of statements
ok      github.com/aquaproj/aqua/v2/pkg/controller/update/ast   (cached)    coverage: 78.9% of statements
ok      github.com/aquaproj/aqua/v2/pkg/controller/updatechecksum   (cached)    coverage: 62.2% of statements
?       github.com/aquaproj/aqua/v2/pkg/testutil    [no test files]
?       github.com/aquaproj/aqua/v2/pkg/timer   [no test files]
ok      github.com/aquaproj/aqua/v2/pkg/controller/which    1.260s  coverage: 63.4% of statements
ok      github.com/aquaproj/aqua/v2/pkg/cosign  (cached)    coverage: 61.7% of statements
ok      github.com/aquaproj/aqua/v2/pkg/domain  (cached)    coverage: 40.0% of statements
ok      github.com/aquaproj/aqua/v2/pkg/download    (cached)    coverage: 14.7% of statements
ok      github.com/aquaproj/aqua/v2/pkg/exec    (cached)    coverage: 24.4% of statements
ok      github.com/aquaproj/aqua/v2/pkg/expr    (cached)    coverage: 71.1% of statements
ok      github.com/aquaproj/aqua/v2/pkg/fuzzyfinder (cached)    coverage: 55.2% of statements
ok      github.com/aquaproj/aqua/v2/pkg/github  (cached)    coverage: 14.7% of statements
ok      github.com/aquaproj/aqua/v2/pkg/install-registry    1.237s  coverage: 65.5% of statements
ok      github.com/aquaproj/aqua/v2/pkg/installpackage  (cached)    coverage: 41.2% of statements
ok      github.com/aquaproj/aqua/v2/pkg/log (cached)    coverage: 35.7% of statements
ok      github.com/aquaproj/aqua/v2/pkg/osfile  (cached)    coverage: 8.6% of statements
ok      github.com/aquaproj/aqua/v2/pkg/policy  (cached)    coverage: 51.4% of statements
ok      github.com/aquaproj/aqua/v2/pkg/runtime (cached)    coverage: 75.6% of statements
ok      github.com/aquaproj/aqua/v2/pkg/slsa    (cached)    coverage: 28.9% of statements
ok      github.com/aquaproj/aqua/v2/pkg/template    (cached)    coverage: 76.5% of statements
ok      github.com/aquaproj/aqua/v2/pkg/unarchive   1.337s  coverage: 52.2% of statements
ok      github.com/aquaproj/aqua/v2/pkg/versiongetter   1.258s  coverage: 64.8% of statements
suzuki-shunsuke commented 1 year ago
suzuki-shunsuke commented 1 year ago

https://github.com/mfridman/tparse

go test ./... -race -covermode=atomic -json | tparse -notests -sort cover -format markdown -smallscreen
STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟒 PASS (cached) v2/pkg/config-finder 96.7% 13 0 0
🟒 PASS (cached) v2/pkg/controller/initpolicy 88.9% 3 0 0
🟒 PASS (cached) v2/pkg/controller/initcmd 82.4% 3 0 0
🟒 PASS (cached) v2/pkg/config/aqua 79.8% 28 0 0
🟒 PASS (cached) v2/pkg/controller/update/ast 78.9% 4 0 0
🟒 PASS (cached) v2/pkg/config-reader 78.4% 8 0 0
🟒 PASS (cached) v2/pkg/template 76.5% 3 0 0
🟒 PASS (cached) v2/pkg/runtime 75.6% 6 0 0
🟒 PASS (cached) v2/pkg/controller/update 72.7% 7 0 0
🟒 PASS (cached) v2/pkg/controller/cp 72.0% 3 0 0
🟒 PASS (cached) v2/pkg/expr 71.1% 16 0 0
🟒 PASS (cached) v2/pkg/controller/generate 67.6% 10 0 0
🟒 PASS (cached) v2/pkg/install-registry 65.5% 2 0 0
🟒 PASS (cached) v2/pkg/versiongetter 64.8% 22 0 0
🟒 PASS (cached) v2/pkg/controller/which 63.4% 6 0 0
🟒 PASS (cached) v2/pkg/controller/updatechecksum 62.2% 3 0 0
🟒 PASS (cached) v2/pkg/cosign 61.7% 3 0 0
🟒 PASS (cached) v2/pkg/fuzzyfinder 55.2% 9 0 0
🟒 PASS (cached) v2/pkg/controller/exec 53.2% 5 0 0
🟒 PASS (cached) v2/pkg/unarchive 52.2% 16 0 0
🟒 PASS (cached) v2/pkg/policy 51.4% 23 0 0
🟒 PASS (cached) v2/pkg/controller/list 50.0% 2 0 0
🟒 PASS (cached) v2/pkg/config 47.9% 46 0 0
🟒 PASS (cached) v2/pkg/controller/install 47.4% 2 0 0
🟒 PASS (cached) v2/pkg/checksum 45.6% 25 0 0
🟒 PASS (cached) v2/pkg/installpackage 41.2% 14 0 0
🟒 PASS (cached) v2/pkg/domain 40.0% 6 0 0
🟒 PASS (cached) v2/pkg/config/registry 40.0% 47 0 0
🟒 PASS (cached) v2 36.5% 6 0 0
/pkg
/controller
/generate-registry
🟒 PASS (cached) v2/pkg/log 35.7% 2 0 0
🟒 PASS (cached) v2/pkg/asset 34.6% 28 0 0
🟒 PASS (cached) v2/pkg/slsa 28.9% 2 0 0
🟒 PASS (cached) v2/pkg/exec 24.4% 2 0 0
🟒 PASS (cached) v2/pkg/download 14.7% 8 0 0
🟒 PASS (cached) v2/pkg/github 14.7% 1 0 0
🟒 PASS (cached) v2/pkg/osfile 8.6% 8 0 0
🟒 PASS (cached) v2/pkg/controller/remove 4.9% 3 0 0
🟑 NOTEST 0.00s v2/pkg/controller/allowpolicy -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/pkg/testutil -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/pkg/cargo -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2 -- -- -- --
/pkg
/controller
/generate
/output
[no test files]
🟑 NOTEST 0.00s v2/pkg/cli -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/cmd/aqua -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/pkg/controller -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/cmd/gen-jsonschema -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/pkg/link -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/pkg/controller/denypolicy -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/pkg/errors -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/pkg/timer -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/pkg/controller/info -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/pkg/controller/updateaqua -- -- -- --
[no test files]
🟑 NOTEST 0.00s v2/pkg/ptr -- -- -- --
[no test files]