Files
discord-fishbowl/simple_test.py
matt 824b118e93 Add comprehensive Docker setup with PostgreSQL, Redis, ChromaDB, and Qdrant
- Enhanced install.py with Docker detection and automatic service setup
- Added docker-compose.services.yml for standalone database services
- Created docker-services.sh management script for easy service control
- Added DOCKER.md documentation with complete setup instructions
- Updated requirements.txt for Python 3.13 compatibility
- Added multiple test scripts and configuration files
- Enhanced collaborative creative projects with proper database integration
- Fixed SQLAlchemy metadata field conflicts in database models
- Added comprehensive quickstart and testing guides

Services now available:
- PostgreSQL with Docker
- Redis with Docker
- ChromaDB vector database
- Qdrant vector database (recommended)
- PgAdmin for database administration

The setup script now automatically detects Docker and offers streamlined
installation with one-command service deployment.
2025-07-05 10:01:41 -07:00

143 lines
3.6 KiB
Python

#!/usr/bin/env python3
"""
Simple test to verify basic functionality
"""
import os
import sqlite3
from pathlib import Path
def test_sqlite_connection():
"""Test basic SQLite connection"""
print("🗄️ Testing SQLite database...")
db_path = "fishbowl_test.db"
try:
# Create a simple test table
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS test_table (
id INTEGER PRIMARY KEY,
name TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
""")
cursor.execute("INSERT INTO test_table (name) VALUES (?)", ("test_entry",))
conn.commit()
cursor.execute("SELECT * FROM test_table")
results = cursor.fetchall()
conn.close()
print(f"✅ SQLite working: {len(results)} entries in test table")
return True
except Exception as e:
print(f"❌ SQLite error: {e}")
return False
def test_directories():
"""Test directory structure"""
print("📁 Testing directory structure...")
required_dirs = [
"config",
"data/vector_stores",
"logs",
"src",
"migrations"
]
all_good = True
for dir_path in required_dirs:
if Path(dir_path).exists():
print(f"{dir_path}")
else:
print(f"❌ Missing: {dir_path}")
all_good = False
return all_good
def test_config_files():
"""Test configuration files"""
print("⚙️ Testing configuration files...")
required_files = [
"config/fishbowl_config.json",
".env",
"requirements.txt"
]
all_good = True
for file_path in required_files:
if Path(file_path).exists():
print(f"{file_path}")
else:
print(f"❌ Missing: {file_path}")
all_good = False
return all_good
def test_python_imports():
"""Test key Python imports"""
print("🐍 Testing Python dependencies...")
try:
import sqlalchemy
print(f"✅ SQLAlchemy {sqlalchemy.__version__}")
import aiosqlite
print("✅ aiosqlite")
import pydantic
print(f"✅ Pydantic {pydantic.__version__}")
import httpx
print(f"✅ httpx {httpx.__version__}")
return True
except ImportError as e:
print(f"❌ Import error: {e}")
return False
def main():
print("🐠 Discord Fishbowl Simple Setup Test")
print("=" * 50)
tests = [
("Directory Structure", test_directories),
("Config Files", test_config_files),
("Python Dependencies", test_python_imports),
("SQLite Database", test_sqlite_connection),
]
all_passed = True
for test_name, test_func in tests:
print(f"\n🔧 {test_name}")
print("-" * (len(test_name) + 3))
if not test_func():
all_passed = False
print("\n" + "=" * 50)
if all_passed:
print("🎉 All basic tests passed!")
print("\nNext steps:")
print("1. Install Ollama: https://ollama.ai/")
print("2. Pull a model: ollama pull llama2")
print("3. Test the full system (requires Discord setup)")
print("4. Run creative collaboration demo: python scripts/demo_creative_integration.py")
else:
print("💥 Some tests failed - setup needs attention")
return all_passed
if __name__ == "__main__":
success = main()
exit(0 if success else 1)