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

22 lines
617 B
Go
Raw Normal View History

package transactions
import (
"fmt"
"os"
"testing"
)
// TestMain skips the entire transactions test suite when Docker is unavailable.
// All tests in this package rely on testcontainers-go to spin up a real Postgres
// container so transactional rollback semantics can be validated.
//
// 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("transactions: skipping package (VEZA_SKIP_INTEGRATION=1)")
os.Exit(0)
}
os.Exit(m.Run())
}