An experimental integration testing framework for Cloud Native Buildpacks written in Rust with libcnb.rs.
This crate is marked as experimental. It currently implements the most basic building blocks for writing
integration tests with libcnb.rs. Its feature set is deliberately cut down to get ball rolling and get a better feel
which features are required. See issues tagged with libcnb-test
for possible future improvements.
Please use the same tag for feature requests.
```rust,norun // In $CRATEROOT/tests/integrationtest.rs use libcnbtest::{assert_contains, BuildpackReference, TestRunner, TestConfig};
fn test() { TestRunner::default().runtest( TestConfig::new("heroku/builder:22", "test-fixtures/app"), |context| { assertcontains!(context.packstdout, "---> Maven Buildpack"); assertcontains!(context.packstdout, "---> Installing Maven"); assertcontains!(context.pack_stdout, "---> Running mvn package");
context
.prepare_container()
.expose_port(12345)
.start_with_default_process(|container| {
assert_eq!(
call_test_fixture_service(
container.address_for_port(12345).unwrap(),
"Hagbard Celine"
)
.unwrap(),
"enileC drabgaH"
);
});
},
);
}
fn calltestfixture_service(addr: std::net::SocketAddr, payload: &str) -> ResultKnown issues
machine
executor rather
than the remote docker feature.