artifactize-core 0.27.2

The library behind artifactize: Artifacts, evals, reviews, the monitor and review models, and the shared operations every interface calls.
Documentation
use super::*;
use crate::verify_tools::Call;
use std::{fs, path::Path};

#[tokio::test]
async fn inspection_never_pages_output_if_credentials_cannot_be_read() {
    let root = crate::test_os::tempdir();
    let repo = root.path().join("repo");
    let definitions = repo.join(".artifactize");
    fs::create_dir_all(&definitions).unwrap();
    fs::create_dir(repo.join("input")).unwrap();
    fs::write(
        definitions.join("fixture.artf"),
        r#"artf fixture = { path = "input" }"#,
    )
    .unwrap();
    assert!(inspect::config_check(&repo).unwrap().ok);
    let state = root.path().join("state");
    let provider = root.path().join("state.provider");
    crate::platform::create_private_dir_all(&provider).unwrap();
    // A directory in place of the provider credential file passes location resolution but
    // cannot be read as credentials. The valid config report must not be returned as a page.
    fs::create_dir(provider.join("providers.json")).unwrap();
    let context = runs::Context::new(&repo, Some(&state), Path::new("unused")).unwrap();
    let call = Call::parse(
        "config_check",
        Default::default(),
        time::OffsetDateTime::UNIX_EPOCH,
    )
    .unwrap();
    assert!(matches!(
        call.execute(&context, CancellationToken::new()).await,
        Err(Error::CredentialInventory),
    ));
}