From 3676c5889eea9e880b221f9fb7a8d6eb641c929a Mon Sep 17 00:00:00 2001 From: Andrei Aaron Date: Sun, 5 Feb 2023 09:21:45 +0200 Subject: [PATCH] test: avoid running trivy tests if search build label is missing (#1172) The 'test' makefile target runs the tests for both 'minimal' and equivalent of the former 'extended' build. The trivy package tests were run twice, even if the trivy logic is unreachable if search is disabled. With this update we should see a cut of about 150s of test time. Signed-off-by: Andrei Aaron --- pkg/extensions/search/cve/pagination_test.go | 3 +++ pkg/extensions/search/cve/trivy/scanner_internal_test.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pkg/extensions/search/cve/pagination_test.go b/pkg/extensions/search/cve/pagination_test.go index 5f7fbebb..e22e7a13 100644 --- a/pkg/extensions/search/cve/pagination_test.go +++ b/pkg/extensions/search/cve/pagination_test.go @@ -1,3 +1,6 @@ +//go:build search +// +build search + package cveinfo_test import ( diff --git a/pkg/extensions/search/cve/trivy/scanner_internal_test.go b/pkg/extensions/search/cve/trivy/scanner_internal_test.go index 3a1fe1bc..497368ff 100644 --- a/pkg/extensions/search/cve/trivy/scanner_internal_test.go +++ b/pkg/extensions/search/cve/trivy/scanner_internal_test.go @@ -1,3 +1,6 @@ +//go:build search +// +build search + package trivy import (