- 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
16 lines
185 B
Go
16 lines
185 B
Go
//go:build !integration
|
|
|
|
package backend
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"music-server/internal/logging"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
logging.Init("fatal", false)
|
|
os.Exit(m.Run())
|
|
}
|