···2233import (
44 "context"
55- "crypto/rsa"
65 "crypto/tls"
76 "database/sql"
87 "encoding/base64"
···2221// Shared test key to avoid generating a new RSA key for each test
2322// Generating a 2048-bit RSA key takes ~0.15s, so reusing one key saves ~4.5s for 32 tests
2423var (
2525- sharedTestKey *rsa.PrivateKey
2624 sharedTestKeyPath string
2725 sharedTestKeyOnce sync.Once
2826 sharedTestKeyDir string
-1
pkg/auth/token/issuer_test.go
···1919// Shared test key to avoid generating a new RSA key for each test
2020// Generating a 2048-bit RSA key takes ~0.15s, so reusing one key saves significant time
2121var (
2222- issuerSharedTestKey *rsa.PrivateKey
2322 issuerSharedTestKeyPath string
2423 issuerSharedTestKeyOnce sync.Once
2524 issuerSharedTestKeyDir string
-20
pkg/hold/pds/records_test.go
···11package pds
2233import (
44- "context"
54 "os"
65 "path/filepath"
76 "testing"
8799- "github.com/bluesky-social/indigo/repo"
108 _ "github.com/mattn/go-sqlite3"
119)
1210···607605 t.Errorf("Expected captain count 1 after deleting crew, got %d", count)
608606 }
609607}
610610-611611-// mockRepo is a minimal mock for testing backfill
612612-// Note: Full backfill testing requires integration tests with real repo
613613-type mockRepo struct {
614614- records map[string]string // key -> cid
615615-}
616616-617617-func (m *mockRepo) ForEach(ctx context.Context, prefix string, fn func(string, any) error) error {
618618- for k, v := range m.records {
619619- if err := fn(k, v); err != nil {
620620- if err == repo.ErrDoneIterating {
621621- return nil
622622- }
623623- return err
624624- }
625625- }
626626- return nil
627627-}