Something went wrong. Try again.
POC : Observability infrastructure managment
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142use crate::config::{Auth, Config, Grafana, Hub, Satellite};use crate::render;
fn sample() -> Config { Config { hub: Hub { host: "hub.example.com".into(), user: "deploy".into(), path: "/opt/sope/hub".into(), grafana_port: 3000, grafana_bind: "0.0.0.0".into(), ingest_bind: "0.0.0.0".into(), }, auth: Auth { token: "secret-token".into(), }, satellites: vec![Satellite { name: "local".into(), host: "hub.example.com".into(), user: "deploy".into(), path: "/opt/sope/sat".into(), }], grafana: Grafana::default(), }}
#[test]fn colocated_satellite_uses_loopback_and_shifted_otlp() { let dir = std::env::temp_dir().join(format!("sope-render-{}", std::process::id())); let _ = std::fs::remove_dir_all(&dir); std::fs::create_dir_all(&dir).unwrap();
let cfg = sample(); render::render_satellite(&cfg, "local", &dir).unwrap(); let compose = std::fs::read_to_string(dir.join("docker-compose.yml")).unwrap(); assert!(compose.contains("SOPE_HUB: \"127.0.0.1\"")); assert!(compose.contains("127.0.0.1:14317:4317")); assert!(compose.contains("127.0.0.1:14318:4318"));
let _ = std::fs::remove_dir_all(&dir);}