Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Jun 4, 2024
1 parent a1e1bd6 commit 88e840d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"},
Expand Down Expand Up @@ -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"},
Expand Down Expand Up @@ -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"},
Expand All @@ -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"},
Expand Down Expand Up @@ -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{},
Expand Down Expand Up @@ -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{}},
Expand Down Expand Up @@ -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"},
Expand All @@ -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"},
Expand Down Expand Up @@ -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"},
Expand Down

0 comments on commit 88e840d

Please sign in to comment.