| Crates.io | dogana |
| lib.rs | dogana |
| version | 0.1.0-1 |
| created_at | 2025-04-23 11:19:28.524321+00 |
| updated_at | 2025-04-23 11:19:28.524321+00 |
| description | A simple framework to run integration tests of CLI projects inside a container |
| homepage | |
| repository | https://github.com/asperan/dogana |
| max_upload_size | |
| id | 1645396 |
| size | 48,212 |
Dogana is a rust library for running integration tests for CLI tools in containers.
Dogana divides the test in three phases:
Install this crate (as a dev dependency) with cargo:
cargo add --dev dogana
This crate requires that all tested packages have a name and a version.
Optionally, you can specify the rust-version of your crate and Dogana will detect it.
Also, you can configure required packages for each image variant. To do so, refer to the crate documentation.
For each test that requires a container, create a tesst method which builds a DoganaTest:
use dogana::{
dogana_images::DEBIAN_IMAGE,
dogana_test::{builder::DoganaTestBuilder, test_options::DoganaTestOptions, DoganaTestResult},
};
#[test]
fn basic_integration_test() -> DoganaTestResult {
DoganaTestBuilder::new()
.set_test_options(DoganaTestOptions {
keep_old_containers: true,
..Default::default()
})
.set_base_image(&DEBIAN_IMAGE)
.set_run_commands(&["echo \"test\""])
.set_expected_output("test")
.build()
.run()
}