Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ live-smoke:

test-live-smoke:
./scripts/live-smoke-test.sh
go test -tags=keyring_nopassage,spotify_live ./internal/livesmoke -run '^$$'
go test -tags=keyring_nopassage,spotify_live ./internal/client ./internal/credentials -run '^$$'

lint:
golangci-lint run
Expand Down
15 changes: 2 additions & 13 deletions cmd/sptfy/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,16 @@ import (
"testing"
"time"

"github.com/open-cli-collective/cli-common/credstore"
"github.com/open-cli-collective/cli-common/statedir"
"github.com/open-cli-collective/cli-common/statedirtest"

"github.com/open-cli-collective/spotify-cli/internal/cmd/root"
"github.com/open-cli-collective/spotify-cli/internal/config"
"github.com/open-cli-collective/spotify-cli/internal/credentials"
"github.com/open-cli-collective/spotify-cli/internal/credstoretest"
"github.com/open-cli-collective/spotify-cli/internal/exitcode"
)

type processFailStore struct{ err error }

func (s processFailStore) Backend() (credstore.Backend, credstore.Source) {
return credstore.BackendMemory, credstore.SourceExplicit
}
func (s processFailStore) Close() error { return nil }
func (s processFailStore) Get(string, string) (string, error) { return "", s.err }
func (s processFailStore) Set(string, string, string, ...credstore.SetOpt) error { return s.err }
func (s processFailStore) Delete(string, string) error { return s.err }
func (s processFailStore) Exists(string, string) (bool, error) { return false, s.err }

func TestUnknownCommandsExitUsage(t *testing.T) {
for _, args := range [][]string{{"frobnicate"}, {"config", "frobnicate"}} {
var out, errOut bytes.Buffer
Expand Down Expand Up @@ -114,7 +103,7 @@ func TestCredentialStoreFailureIsSecretSafeAtProcessBoundary(t *testing.T) {
Scope: statedir.Scope{Name: config.Service}, Cache: statedir.Cache{Tool: config.Tool}, Data: statedir.Data{Tool: config.Tool},
Now: func() time.Time { return time.Date(2026, 7, 22, 12, 0, 0, 0, time.UTC) },
OpenStore: func(credentials.OpenRequest) (credentials.Store, error) {
return processFailStore{err: errors.New("backend echoed " + canary)}, nil
return &credstoretest.Store{SetErr: errors.New("backend echoed " + canary)}, nil
},
})
cmd.SetArgs(args)
Expand Down
Loading
Loading