//go:build integration
// +build integration

package main

import (
	"database/sql"
	"testing"
	"time"

	_ "github.com/jackc/pgx/v5/stdlib"
)

// TestDatabaseIntegration is only run when -tags integration is specified
func TestDatabaseIntegration(t *testing.T) {
	// This test requires a real database connection
	db, err := sql.Open("pgx", "postgres://localhost/testdb?sslmode=disable")
	if err != nil {
		t.Skipf("Database not available: %v", err)
	}
	defer db.Close()

	// Verify connection
	if err := db.Ping(); err != nil {
		t.Fatalf("Cannot connect to database: %v", err)
	}

	t.Log("Successfully connected to database")

	// Integration test logic here
	// ...
}

// TestExternalAPIIntegration tests real API calls
func TestExternalAPIIntegration(t *testing.T) {
	t.Log("Testing external API integration...")

	// This test makes real HTTP requests
	// Only run with -tags integration

	time.Sleep(100 * time.Millisecond) // Simulate API call

	t.Log("External API test completed")
}

// TestSlowIntegration demonstrates tests that are too slow for regular runs
func TestSlowIntegration(t *testing.T) {
	t.Log("Running slow integration test...")

	// Simulate a slow operation
	time.Sleep(2 * time.Second)

	t.Log("Slow test completed")
}
