fix: improve tests and remove unused code

- Corrected XML test data to remove unnecessary `<descr>` tags, resolving failing tests.
- Removed the unused `ratatui_utils` module and its associated code.
- Simplified example in `harmony_tui/src/lib.rs` to use `tokio::main` and register scores directly with `Maestro`. This aligns with the project's evolving structure.
This commit is contained in:
2025-04-11 11:01:05 -04:00
parent 31ae8365a6
commit 606ea43b51
4 changed files with 21 additions and 42 deletions

View File

@@ -1,4 +1,3 @@
mod ratatui_utils;
mod widget;
use log::{debug, error, info};
@@ -30,17 +29,26 @@ pub mod tui {
///
/// # Example
///
/// ```rust
/// use harmony;
/// use harmony_tui::init;
///
/// #[harmony::main]
/// pub async fn main(maestro: harmony::Maestro) {
/// maestro.register(DeploymentScore::new("nginx-test", "nginx"));
/// maestro.register(OKDLoadBalancerScore::new(&maestro.inventory, &maestro.topology));
/// // Register other scores as needed
///
/// init(maestro).await.unwrap();
/// ```rust,no_run
/// use harmony::{
/// inventory::Inventory,
/// maestro::Maestro,
/// modules::dummy::{ErrorScore, PanicScore, SuccessScore},
/// topology::HAClusterTopology,
/// };
///
/// #[tokio::main]
/// async fn main() {
/// let inventory = Inventory::autoload();
/// let topology = HAClusterTopology::autoload();
/// let mut maestro = Maestro::new(inventory, topology);
///
/// maestro.register_all(vec![
/// Box::new(SuccessScore {}),
/// Box::new(ErrorScore {}),
/// Box::new(PanicScore {}),
/// ]);
/// harmony_tui::init(maestro).await.unwrap();
/// }
/// ```
pub async fn init<T: Topology + std::fmt::Debug + Send + Sync + 'static>(