feat: sync collectible star gifts

This commit is contained in:
A 2026-07-16 12:38:53 +08:00
parent 47fcf0ea41
commit 5ecf4e912d
64 changed files with 7559 additions and 403 deletions

View file

@ -5,6 +5,7 @@ import (
"crypto/rand"
"errors"
"os"
"strings"
"testing"
"github.com/jackc/pgx/v5/pgxpool"
@ -19,6 +20,13 @@ func testPool(t *testing.T) *pgxpool.Pool {
if dsn == "" {
t.Skip("set TELESRV_TEST_POSTGRES_DSN to run postgres integration test")
}
parsed, err := pgxpool.ParseConfig(dsn)
if err != nil {
t.Fatalf("parse TELESRV_TEST_POSTGRES_DSN: %v", err)
}
if !strings.Contains(strings.ToLower(parsed.ConnConfig.Database), "test") {
t.Fatalf("TELESRV_TEST_POSTGRES_DSN must name a dedicated test database, got %q", parsed.ConnConfig.Database)
}
if err := Migrate(dsn); err != nil {
t.Fatalf("migrate: %v", err)
}