Documentation
¶
Index ¶
- Constants
- Variables
- func All(t *testing.T, testFunc func(ctx context.Context, t *testing.T, db *gorm.DB))
- func EnableDeadlockLogging(t *testing.T, db *gorm.DB)
- func EscapePath(p string) string
- func GenerateFixedBytes(length int) []byte
- func GenerateRandomBytes(n int) []byte
- func GenerateUniqueName(prefix string) string
- func GetFileTimestamp(t *testing.T, path string) int64
- func One(t *testing.T, testFunc func(ctx context.Context, t *testing.T, db *gorm.DB))
- func OneWithoutReset(t *testing.T, testFunc func(ctx context.Context, t *testing.T, db *gorm.DB))
- func SkipIfNotExternalAPI(t *testing.T)
- type CloserFunc
Constants ¶
const TestLotusAPI = "https://api.node.glif.io/rpc/v1"
TestLotusAPI is the Lotus API endpoint to use for tests Using /rpc/v1 (stable) instead of deprecated /rpc/v0
const TestPrivateKeyHex = "" /* 160-byte string literal not displayed */
const TestWalletAddr = "f1fib3pv7jua2ockdugtz7viz3cyy6lkhh7rfx3sa"
Variables ¶
var SupportedTestDialects = []string{"sqlite", "mysql", "postgres"}
Functions ¶
func EnableDeadlockLogging ¶
EnableDeadlockLogging enables comprehensive deadlock logging for MySQL/MariaDB tests. This should be called early in tests that may encounter deadlocks. It will: - Enable innodb_print_all_deadlocks (logs all deadlocks to error log, not just the last one) - Log the current state of deadlock logging
Note: innodb_print_all_deadlocks requires SUPER privilege and persists until server restart.
func EscapePath ¶ added in v0.4.0
func GenerateFixedBytes ¶ added in v0.4.0
func GenerateRandomBytes ¶
func GenerateUniqueName ¶
GenerateUniqueName creates a unique name for testing by combining a prefix with a UUID suffix
func OneWithoutReset ¶ added in v0.4.0
func SkipIfNotExternalAPI ¶
SkipIfNotExternalAPI skips the test if SINGULARITY_TEST_EXTERNAL_API is not set Use this for tests that make external API calls (e.g., Lotus/Filecoin APIs) These are skipped by default because external APIs may be unreliable or rate-limited
Types ¶
type CloserFunc ¶ added in v0.4.0
type CloserFunc func() error
func (CloserFunc) Close ¶ added in v0.4.0
func (f CloserFunc) Close() error