This guide documents how to run and extend tests for weave-cli.
Location: src/pkg/*/
Run: go test ./src/...
Location: tests/
Run: go test -tags=integration ./tests
Location: Root
Run: ./e2e-tests.sh
Systematically test image ingestion across all supported vector databases to identify size limits, schema issues, and compatibility problems.
tests/image_ingestion_test.go
Tests image ingestion for each VDB:
- ✅ Weaviate Local - No size limit
⚠️ Milvus Local - 64KB JSON field limit (known issue #19)- ✅ Chroma Local
- ✅ Qdrant Local
- ✅ Neo4j Local
- ✅ OpenSearch Local
- ✅ Supabase
- ✅ MongoDB
For each database:
- Creates test collection with image schema
- Ingests small test images (<64KB)
- Verifies collection count matches ingested count
- Handles size limits appropriately
- Cleans up after test
Running:
# All VDBs
go test -v -tags=integration ./tests -run TestImageIngestion_AllVDBs
# Specific VDB (e.g., Weaviate)
go test -v -tags=integration ./tests -run "TestImageIngestion_AllVDBs/Weaviate"
# Skip short mode to run full tests
go test -v -tags=integration ./tests -run TestImageIngestion_AllVDBs -short=falseTests CMYK color space image handling.
Status: Placeholder (test data not yet available)
To enable:
- Add CMYK test image to
tests/images/cmyk_image.png - Remove skip in test
Tests handling of large images (>64KB) to validate size limits.
Status: Placeholder (large test image not yet available)
To enable:
- Add 81KB test image to
tests/images/large_81kb.png - Remove skip in test
Expected results:
- Weaviate: Should handle without error
- Milvus: Should error due to 64KB limit
Existing:
tests/images/dog.pngtests/images/test_*.png(colored test images)
Needed:
tests/images/large_81kb.png- For size limit testingtests/images/cmyk_image.png- For color space testing
For each VDB, tests verify:
- Collections create successfully
- All images within size limit ingest correctly
- Document counts match expected
- No silent failures or truncation
- Proper error handling for oversized images
Milvus 64KB Limit (Issue #19)
- Milvus has a 64KB limit on JSON fields
- Images larger than ~64KB will fail to ingest
- Test skips large images for Milvus
- Marked as known limitation in test
Validate PDF text and image extraction across different PDF versions (1.3 to 2.0) and content types (text-only, scanned, mixed, photo-heavy).
tests/pdf_integration_test.go
Tests extraction from PDFs of different versions:
| Version | Year | Features | Status |
|---|---|---|---|
| PDF 1.3 | 1999 | Basic features | Placeholder |
| PDF 1.4 | 2001 | CMYK, transparency | Placeholder |
| PDF 1.7 | 2006 | Modern features | Placeholder |
| PDF 2.0 | 2017 | Latest spec | Placeholder |
| ragme-io.pdf | Current | Working baseline | ✅ Active |
For each version:
- Extracts text and images
- Verifies extraction succeeded
- Validates metadata fields
- Logs extraction statistics
Running:
# All PDF versions
go test -v ./tests -run TestPDFVersionCompatibility
# Specific version
go test -v ./tests -run "TestPDFVersionCompatibility/PDF_1.7"Tests extraction from different PDF content types:
| Type | Text Expected | Images Expected | Status |
|---|---|---|---|
| Text-only | ✅ | ❌ | Placeholder |
| Scanned (OCR) | ❌ | ✅ | Placeholder |
| Mixed | ✅ | ✅ | Placeholder |
| Photo-heavy | ✅ | ✅ (5+) | Placeholder |
| Auction Catalogue | ✅ | ✅ | ✅ Active |
For each type:
- Extracts with images enabled
- Verifies expected content types present
- Validates minimum chunk/image counts
- Logs warnings for unexpected results
Running:
# All PDF types
go test -v ./tests -run TestPDFTypeExtraction
# Specific type
go test -v ./tests -run "TestPDFTypeExtraction/Mixed"Tests handling of PDFs with CMYK color space images.
Status: Placeholder (test PDF not yet available)
To enable:
- Add CMYK PDF to
fixtures/pdf_types/cmyk.pdf - Remove skip in test
Existing:
fixtures/ragme-io.pdf- Working baseline (mixed content)
Needed:
fixtures/pdf_versions/pdf_1.3.pdffixtures/pdf_versions/pdf_1.4.pdffixtures/pdf_versions/pdf_1.7.pdffixtures/pdf_versions/pdf_2.0.pdffixtures/pdf_types/text_only.pdffixtures/pdf_types/scanned.pdffixtures/pdf_types/mixed.pdffixtures/pdf_types/photo_heavy.pdf
Tests verify:
- All PDF versions extract correctly
- Text-only PDFs extract text, no images
- Scanned PDFs detected (no text without OCR)
- Mixed PDFs extract both text and images
- Photo-heavy PDFs extract all images
- Metadata fields preserved across versions
- CMYK images handled correctly
Text-only PDF:
# macOS: Use Pages or TextEdit, export as PDF
# Linux: Use LibreOffice
echo "Test content" | ps2pdf - fixtures/pdf_types/text_only.pdfImage-only PDF (Scanned simulation):
# Convert image to PDF
convert tests/images/dog.png fixtures/pdf_types/scanned.pdfMixed PDF: Use any office suite to create a document with text and embedded images, then export to PDF.
Photo-heavy PDF:
# Combine multiple images into one PDF
convert tests/images/*.png fixtures/pdf_types/photo_heavy.pdfFor testing specific PDF versions, use PDF creation tools that support version selection:
- Adobe Acrobat - Can save as specific PDF version
- LibreOffice - PDF export options include version
- Ghostscript - Can convert to specific versions
Example with Ghostscript:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
-o fixtures/pdf_versions/pdf_1.4.pdf input.pdf# Run only fast tests
go test ./tests -short# Run all integration tests
go test -v -tags=integration ./tests
# Run specific integration test
go test -v -tags=integration ./tests -run TestImageIngestion# Full end-to-end test suite
./e2e-tests.sh
# With specific VDB
./e2e-tests.sh --weaviate-local# Standard local gate before pushing
./lint.sh
./build.sh
./test.sh --coverage# Generate coverage.out, coverage.html, and coverage.txt
./test.sh --coverage
# Regenerate the HTML view manually if needed
go tool cover -html=coverage.out -o coverage.htmlThe v0.15.0 release baseline is 40.06% statement coverage. Current development
coverage is 75.5% statement coverage and 96.70% function coverage. See
tests/COVERAGE_PLAN.md for package details,
milestone history, and the path toward 80%.
- Add to image_ingestion_test.go:
{
name: "MyNewVDB Local",
vdbType: vectordb.VectorDBTypeMyNewVDBLocal,
sizeLimit: 0, // or specific limit if known
},-
Add integration test file: Create
tests/mynewvdb_integration_test.gofollowing existing patterns. -
Update test.sh: Add VDB-specific test flags and logic.
- Add test case to TestPDFTypeExtraction:
{
name: "My New PDF Type",
pdfFile: "fixtures/pdf_types/my_new_type.pdf",
expectedText: true,
expectedImages: true,
minTextChunks: 1,
minImages: 1,
},-
Create test PDF: Add to
fixtures/pdf_types/ -
Update documentation: Add to this guide and relevant docs.
tessbridge.cpp:5:10: fatal error: 'leptonica/allheaders.h' file not found
Solution: Install Tesseract dependencies
# macOS
brew install tesseract leptonica
# Ubuntu/Debian
sudo apt-get install tesseract-ocr libtesseract-dev libleptonica-devProblem: Tests fail to connect to VDB
Solutions:
- Ensure VDB is running:
./tools/vdb/local/<vdb>.sh start - Check config:
weave config show - Verify health:
weave health check --<vdb>-local
Problem: Tests skip due to missing files
Solution: Check skip reasons and add required test data:
# See what's needed
go test -v ./tests -run TestImage 2>&1 | grep "Skip"- Always clean up: Tests should delete collections after completion
- Use meaningful names: Test names should describe what's being tested
- Log useful info: Use
t.Logf()for debugging information - Skip gracefully: Use
t.Skip()with clear reasons for missing data - Verify expectations: Assert both success and failure cases
- Document assumptions: Comment why specific values are expected