- Unit tests use an in-memory fake database (internal/testutil/fakedb), temp folders and httptest; `go test ./...` needs no Docker or env vars - Integration tests (build tag "integration") start PostgreSQL with testcontainers: migrations step by step, SQL dumps (skipped if missing) and a full sync against a real database - Removed tests that only checked copies of the logic or had empty bodies, the broken root integration_test.go, compose.test.yaml and .env.test with hardcoded paths - testMusic MP3s replaced with tiny placeholders (sync never decodes audio), 194 MB -> 168 KB
17 lines
232 B
Go
17 lines
232 B
Go
//go:build integration
|
|
|
|
package db_test
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"music-server/internal/logging"
|
|
"music-server/internal/testutil/pgtest"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
logging.Init("error", false)
|
|
os.Exit(pgtest.Main(m))
|
|
}
|