mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 16:36:21 +02:00
2.4 KiB
2.4 KiB
Quick Test Setup Guide
TL;DR - Just Run This
# From the trustgraph project root directory
./run_tests.sh
This script will:
- Check current imports
- Install all required TrustGraph packages
- Install test dependencies
- Run the VertexAI tests
If You Get Import Errors
The most common issue is that TrustGraph packages aren't installed. Here's how to fix it:
Step 1: Check What's Missing
./check_imports.py
Step 2: Install TrustGraph Packages
./install_packages.sh
Step 3: Verify Installation
./check_imports.py
Step 4: Run Tests
pytest tests/unit/test_text_completion/test_vertexai_processor.py -v
What the Scripts Do
check_imports.py
- Tests all the imports needed for the tests
- Shows exactly what's missing
- Helps diagnose import issues
install_packages.sh
- Installs trustgraph-base (required by others)
- Installs trustgraph-cli
- Installs trustgraph-vertexai
- Installs trustgraph-flow
- Uses
pip install -e .for editable installs
run_tests.sh
- Runs all the above steps in order
- Installs test dependencies
- Runs the VertexAI tests
- Shows clear output at each step
Manual Installation (If Scripts Don't Work)
# Install packages in order (base first!)
cd trustgraph-base && pip install -e . && cd ..
cd trustgraph-cli && pip install -e . && cd ..
cd trustgraph-vertexai && pip install -e . && cd ..
cd trustgraph-flow && pip install -e . && cd ..
# Install test dependencies
cd tests && pip install -r requirements.txt && cd ..
# Run tests
pytest tests/unit/test_text_completion/test_vertexai_processor.py -v
Common Issues
- "No module named 'trustgraph'" → Run
./install_packages.sh - "No module named 'trustgraph.base'" → Install trustgraph-base first
- "No module named 'trustgraph.model.text_completion.vertexai'" → Install trustgraph-vertexai
- Scripts not executable → Run
chmod +x *.sh - Wrong directory → Make sure you're in the project root (where README.md is)
Test Results
When working correctly, you should see:
- ✅ All imports successful
- 139 test cases running
- Tests passing (or failing for logical reasons, not import errors)
Getting Help
If you're still having issues:
- Share the output of
./check_imports.py - Share the exact error message
- Confirm you're in the right directory:
/home/mark/work/trustgraph.ai/trustgraph