refactor(cve): improve CVE test time by mocking trivy (#1184)

- refactor(cve): remove the global of type cveinfo.CveInfo from the extensions package
  Replace it with an attribute on controller level
- refactor(controller): extract initialization logic from controller.Run()
- test(cve): mock cve scanner in cli tests

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
Andrei Aaron
2023-02-10 07:04:52 +02:00
committed by GitHub
parent c1de15c87b
commit d12836e69c
15 changed files with 552 additions and 131 deletions
+4
View File
@@ -81,6 +81,10 @@ func startServer(t *testing.T) (*api.Controller, string) {
ctrl.Config.Storage.SubPaths = subPaths
go func() {
if err := ctrl.Init(context.Background()); err != nil {
return
}
// this blocks
if err := ctrl.Run(context.Background()); err != nil {
return