Major additions: - Community Next.js app (port 18187) for browsing claims with API docs - stemedb-chaos crate: Fault injection, chaos testing, CRDT properties - Latent ingestion system: Reddit/FDA ingesters with ADK-Go agents - Disputed claims handling: Manual review workflows and validation - Aphoria security scanner: New extractors (SQL injection, command injection, weak crypto, TLS version), policy-based ignores, UAT reports - Docker infrastructure: Dockerfile, docker-compose.yml for full stack - VulnBank demo: Intentionally vulnerable multi-language test corpus SDK & API enhancements: - Source registry handlers for tracking data provenance - Metrics endpoint - Skeptic filtering improvements Code quality: - Split 14 large files (>500 lines) into focused modules - All files now under 500-line limit per project guidelines Documentation: - Chaos testing guide, circuit breakers, observability docs - Phase 7 UAT documentation updates - Martin Kleppmann technical writer agent Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
72 lines
1.7 KiB
Go
72 lines
1.7 KiB
Go
package steme
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// Note: context is used in the skipped integration test
|
|
|
|
// TestClientIntegration is a placeholder for integration tests.
|
|
//
|
|
// This would test against a real StemeDB server. For now, it's skipped
|
|
// unless the STEMEDB_URL environment variable is set.
|
|
func TestClientIntegration(t *testing.T) {
|
|
t.Skip("Integration test requires running StemeDB server")
|
|
|
|
// Example integration test structure:
|
|
/*
|
|
baseURL := os.Getenv("STEMEDB_URL")
|
|
if baseURL == "" {
|
|
t.Skip("STEMEDB_URL not set")
|
|
}
|
|
|
|
signer, err := GenerateSigner()
|
|
if err != nil {
|
|
t.Fatalf("GenerateSigner() failed: %v", err)
|
|
}
|
|
|
|
client := NewClient(baseURL, signer)
|
|
|
|
// Test health check
|
|
health, err := client.Health(context.Background())
|
|
if err != nil {
|
|
t.Fatalf("Health() failed: %v", err)
|
|
}
|
|
|
|
if health.Status != "healthy" {
|
|
t.Errorf("Health.Status = %s, want healthy", health.Status)
|
|
}
|
|
|
|
// Test assertion creation
|
|
assertion := NewAssertion("test_entity", "test_predicate").
|
|
WithText("test value").
|
|
WithConfidence(0.95).
|
|
WithSourceHash("0000000000000000000000000000000000000000000000000000000000000000").
|
|
Build()
|
|
|
|
hash, err := client.Assert(context.Background(), assertion)
|
|
if err != nil {
|
|
t.Fatalf("Assert() failed: %v", err)
|
|
}
|
|
|
|
if len(hash) != 64 {
|
|
t.Errorf("Assert() hash length = %d, want 64", len(hash))
|
|
}
|
|
|
|
// Test query
|
|
params := NewQuery().
|
|
WithSubject("test_entity").
|
|
WithPredicate("test_predicate").
|
|
Build()
|
|
|
|
result, err := client.Query(context.Background(), params)
|
|
if err != nil {
|
|
t.Fatalf("Query() failed: %v", err)
|
|
}
|
|
|
|
if result.TotalCount == 0 {
|
|
t.Errorf("Query() returned no results")
|
|
}
|
|
*/
|
|
}
|