veza/veza-backend-api/internal/testutils/setup_test_helper.go
senke 286be8ba1d
Some checks failed
Backend API CI / test-unit (push) Failing after 0s
Backend API CI / test-integration (push) Failing after 0s
Frontend CI / test (push) Failing after 0s
Storybook Audit / Build & audit Storybook (push) Failing after 0s
chore(v0.102): consolidate remaining changes — docs, frontend, backend
- docs: SCOPE_CONTROL, CONTRIBUTING, README, .github templates
- frontend: DeveloperDashboardView, Player components, MSW handlers, auth, reactQuerySync
- backend: playback_analytics, playlist_service, testutils, integration README

Excluded (artifacts): .auth, playwright-report, test-results, storybook_audit_detailed.json
2026-02-20 13:02:12 +01:00

18 lines
449 B
Go

package testutils
import (
"os/exec"
"testing"
)
// SkipIfDockerUnavailable skips the test if Docker is not available (for testcontainers).
// Also skips when testing.Short() is true.
func SkipIfDockerUnavailable(t *testing.T) {
t.Helper()
if testing.Short() {
t.Skip("Skipping database test in short mode")
}
if _, err := exec.LookPath("docker"); err != nil {
t.Skip("Docker not available, skipping test requiring testcontainers")
}
}