veza/veza-backend-api/tests/integration/main_test.go

22 lines
611 B
Go
Raw Normal View History

package integration
import (
"fmt"
"os"
"testing"
)
// TestMain skips the entire integration test suite when Docker is unavailable
// (no /var/run/docker.sock). Integration tests rely on testcontainers for
// Postgres, Redis, etc., and have no meaningful behavior without them.
//
// Set by CI: VEZA_SKIP_INTEGRATION=1 on Forgejo runners that don't expose
// the Docker socket. Local dev / nightly jobs leave it unset.
func TestMain(m *testing.M) {
if os.Getenv("VEZA_SKIP_INTEGRATION") == "1" {
fmt.Println("integration: skipping package (VEZA_SKIP_INTEGRATION=1)")
os.Exit(0)
}
os.Exit(m.Run())
}