helm-rs 0.1.2

Typed Rust API for Helm 4: swappable backends, native chart, values and release reading
Documentation
//! Integration tests that need the real `helm` binary and the network; run with
//! `--run-ignored only`.

use helm_rs::Helm;
use helm_rs::command::SearchHub;

#[tokio::test]
#[ignore = "needs network"]
async fn search_hub_finds_charts_on_artifact_hub() {
    let helm = Helm::detect().await.expect("helm 4 on PATH");
    let found = helm
        .run(SearchHub {
            keyword: Some("ingress-nginx".into()),
            ..SearchHub::default()
        })
        .await
        .expect("search");

    assert_ne!(found.len(), 0);
    assert!(
        found[0]
            .url
            .starts_with("https://artifacthub.io/packages/helm/")
    );
    assert_ne!(found[0].repository.name.len(), 0);
}

#[tokio::test]
#[ignore = "needs network"]
async fn search_hub_without_a_match_is_empty_or_fails_when_asked() {
    let helm = Helm::detect().await.expect("helm 4 on PATH");
    let none = SearchHub {
        keyword: Some("zzzzqqqqxxxx".into()),
        ..SearchHub::default()
    };
    let strict = SearchHub {
        fail_on_no_result: true,
        ..none.clone()
    };

    assert_eq!(helm.run(none).await.expect("search").len(), 0);
    assert!(helm.run(strict).await.is_err());
}