mirror of
https://github.com/anchore/syft.git
synced 2026-10-30 22:12:28 +01:00
Fix passing "--key" to the attest command. Additionally, pull in an update to the clio CLI library to permit unit testing that flags and env vars are parsed to the correct field on command options structs. This testing strategy was needed here because testing attestation in an end to end test requires a prohibitive amount of setup. --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> Signed-off-by: Will Murphy <will.murphy@anchore.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
21 lines
528 B
Go
21 lines
528 B
Go
package commands
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
gologgerredact "github.com/anchore/go-logger/adapter/redact"
|
|
"github.com/anchore/syft/internal/redact"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
// Initialize global state needed to test clio/cobra commands directly
|
|
// Should be kept minimal.
|
|
|
|
// Initialize redact store once for all tests in the commands package
|
|
// Redact store must be wired up here because syft will panic unless
|
|
// a redact store is wired up exactly once
|
|
redact.Set(gologgerredact.NewStore())
|
|
os.Exit(m.Run())
|
|
}
|