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>
68 lines
1.9 KiB
Rust
68 lines
1.9 KiB
Rust
use super::*;
|
|
use std::net::{IpAddr, Ipv4Addr};
|
|
|
|
fn test_addr(port: u16) -> SocketAddr {
|
|
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port)
|
|
}
|
|
|
|
#[test]
|
|
fn test_swim_config_defaults() {
|
|
let config = SwimConfig::default();
|
|
assert_eq!(config.gossip_interval, Duration::from_millis(200));
|
|
assert_eq!(config.probe_interval, Duration::from_secs(1));
|
|
assert_eq!(config.indirect_probe_count, 3);
|
|
}
|
|
|
|
#[test]
|
|
fn test_swim_config_builder() {
|
|
let config = SwimConfig::new()
|
|
.with_gossip_interval(Duration::from_millis(100))
|
|
.with_probe_interval(Duration::from_millis(500));
|
|
|
|
assert_eq!(config.gossip_interval, Duration::from_millis(100));
|
|
assert_eq!(config.probe_interval, Duration::from_millis(500));
|
|
}
|
|
|
|
#[test]
|
|
fn test_sharding_config_defaults() {
|
|
let config = ShardingConfig::default();
|
|
assert_eq!(config.num_shards, 16);
|
|
assert_eq!(config.replication_factor, 3);
|
|
assert_eq!(config.split_threshold_bytes, 64 * 1024 * 1024);
|
|
}
|
|
|
|
#[test]
|
|
fn test_cluster_config_builder() {
|
|
let config = ClusterConfig::builder()
|
|
.with_rpc_addr(test_addr(9090))
|
|
.with_api_addr(test_addr(8080))
|
|
.with_seed_node(test_addr(9091))
|
|
.with_datacenter("us-east-1")
|
|
.build();
|
|
|
|
assert!(config.is_ok());
|
|
let config = config.unwrap();
|
|
assert_eq!(config.rpc_addr.port(), 9090);
|
|
assert_eq!(config.api_addr.port(), 8080);
|
|
assert_eq!(config.seed_nodes.len(), 1);
|
|
assert_eq!(config.datacenter, Some("us-east-1".to_string()));
|
|
}
|
|
|
|
#[test]
|
|
fn test_cluster_config_builder_missing_required() {
|
|
let result = ClusterConfig::builder().build();
|
|
assert!(result.is_err());
|
|
}
|
|
|
|
#[test]
|
|
fn test_swim_addr() {
|
|
let config = ClusterConfig::builder()
|
|
.with_rpc_addr(test_addr(9090))
|
|
.with_api_addr(test_addr(8080))
|
|
.build()
|
|
.unwrap();
|
|
|
|
let swim_addr = config.swim_addr();
|
|
assert_eq!(swim_addr.port(), 18183); // Default swim port (181XX scheme)
|
|
}
|