From 88e840d8b9a7a168f10f6917b6d15354c4dba9a1 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 3 Jun 2024 21:55:10 -0600 Subject: [PATCH] Fix tests --- account_test.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/account_test.go b/account_test.go index 24389c0..45697ec 100644 --- a/account_test.go +++ b/account_test.go @@ -25,6 +25,8 @@ import ( "sync" "testing" "time" + + "go.uber.org/zap" ) // memoryStorage is an in-memory storage implementation with known contents *and* fixed iteration order for List. @@ -153,7 +155,7 @@ func (r *recordingStorage) record(name string, args ...interface{}) { var _ Storage = (*recordingStorage)(nil) func TestNewAccount(t *testing.T) { - am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)} + am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)} testConfig := &Config{ Issuers: []Issuer{am}, Storage: &FileStorage{Path: "./_testdata_tmp"}, @@ -181,7 +183,7 @@ func TestNewAccount(t *testing.T) { func TestSaveAccount(t *testing.T) { ctx := context.Background() - am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)} + am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)} testConfig := &Config{ Issuers: []Issuer{am}, Storage: &FileStorage{Path: "./_testdata1_tmp"}, @@ -217,7 +219,7 @@ func TestSaveAccount(t *testing.T) { func TestGetAccountDoesNotAlreadyExist(t *testing.T) { ctx := context.Background() - am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)} + am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)} testConfig := &Config{ Issuers: []Issuer{am}, Storage: &FileStorage{Path: "./_testdata_tmp"}, @@ -239,7 +241,7 @@ func TestGetAccountDoesNotAlreadyExist(t *testing.T) { func TestGetAccountAlreadyExists(t *testing.T) { ctx := context.Background() - am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)} + am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)} testConfig := &Config{ Issuers: []Issuer{am}, Storage: &FileStorage{Path: "./_testdata2_tmp"}, @@ -288,7 +290,7 @@ func TestGetAccountAlreadyExists(t *testing.T) { func TestGetAccountAlreadyExistsSkipsBroken(t *testing.T) { ctx := context.Background() - am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)} + am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)} testConfig := &Config{ Issuers: []Issuer{am}, Storage: &memoryStorage{}, @@ -337,7 +339,7 @@ func TestGetAccountAlreadyExistsSkipsBroken(t *testing.T) { func TestGetAccountWithEmailAlreadyExists(t *testing.T) { ctx := context.Background() - am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)} + am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)} testConfig := &Config{ Issuers: []Issuer{am}, Storage: &recordingStorage{Storage: &memoryStorage{}}, @@ -404,7 +406,7 @@ func TestGetEmailFromPackageDefault(t *testing.T) { discoveredEmail = "" }() - am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)} + am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)} testConfig := &Config{ Issuers: []Issuer{am}, Storage: &FileStorage{Path: "./_testdata2_tmp"}, @@ -426,7 +428,7 @@ func TestGetEmailFromPackageDefault(t *testing.T) { func TestGetEmailFromUserInput(t *testing.T) { ctx := context.Background() - am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)} + am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)} testConfig := &Config{ Issuers: []Issuer{am}, Storage: &FileStorage{Path: "./_testdata3_tmp"}, @@ -461,7 +463,7 @@ func TestGetEmailFromUserInput(t *testing.T) { func TestGetEmailFromRecent(t *testing.T) { ctx := context.Background() - am := &ACMEIssuer{CA: dummyCA, mu: new(sync.Mutex)} + am := &ACMEIssuer{CA: dummyCA, Logger: zap.NewNop(), mu: new(sync.Mutex)} testConfig := &Config{ Issuers: []Issuer{am}, Storage: &FileStorage{Path: "./_testdata4_tmp"},