duende-test

Crates.ioduende-test
lib.rsduende-test
version0.2.0
created_at2026-01-06 14:14:51.865079+00
updated_at2026-01-13 12:17:21.655981+00
descriptionTesting infrastructure for Duende (harness, chaos injection, load testing)
homepage
repositoryhttps://github.com/paiml/duende
max_upload_size
id2025940
size219,468
Noah Gift (noahgift)

documentation

README

duende-test

Testing infrastructure for the Duende daemon framework.

Crates.io Documentation License

Overview

This crate provides testing utilities:

  • Test harness: Daemon lifecycle testing utilities
  • Chaos injection: Latency, errors, packet loss simulation
  • Load testing: Performance testing under load
  • Falsification tests: 110 Popperian tests for spec compliance

Usage

Test Harness

use duende_test::{DaemonTestHarness, ChaosConfig};

let harness = DaemonTestHarness::builder()
    .with_platform(Platform::Native)
    .build();

let handle = harness.spawn(my_daemon).await?;
assert!(handle.health_check().await?.is_healthy());

Chaos Testing

use duende_test::ChaosConfig;
use std::time::Duration;

let harness = DaemonTestHarness::builder()
    .with_chaos(ChaosConfig {
        latency_probability: 0.1,
        latency_duration: Duration::from_millis(500),
        error_probability: 0.05,
        ..Default::default()
    })
    .build();

// Daemon should remain healthy under chaos
let handle = harness.spawn(my_daemon).await?;
tokio::time::sleep(Duration::from_secs(30)).await;
assert!(handle.health_check().await?.is_healthy());

Load Testing

use duende_test::{LoadTester, LoadTestConfig};

let tester = LoadTester::new();
let config = LoadTestConfig::stress();

let report = tester.run(config).await?;
assert!(report.passed());
println!("P99 latency: {:?}", report.latency_p99);

Feature Flags

Feature Description
falsification Enable 110 Popperian falsification tests

Iron Lotus Framework

  • Built-in Quality (品質の作り込み): Quality cannot be inspected in
  • Popperian Falsification: Tests designed to refute claims
  • Extreme TDD: Write failing tests first

License

MIT OR Apache-2.0

Commit count: 20

cargo fmt