Struct libcnb_test::IntegrationTestContext
source · [−]pub struct IntegrationTestContext<'a> {
pub pack_stdout: String,
pub pack_stderr: String,
pub image_name: String,
pub app_dir: PathBuf,
/* private fields */
}
Expand description
Context for a currently executing integration test.
Fields
pack_stdout: String
Standard output of pack
, interpreted as an UTF-8 string.
pack_stderr: String
Standard error of pack
, interpreted as an UTF-8 string.
image_name: String
The name of the image this integration test created.
app_dir: PathBuf
The directory of the app this integration test uses.
This is a copy of the app_dir
directory passed to IntegrationTest::new
and unique to
this integration test run. It is safe to modify the directory contents inside the test.
Implementations
sourceimpl<'a> IntegrationTestContext<'a>
impl<'a> IntegrationTestContext<'a>
sourcepub fn prepare_container(&self) -> PrepareContainerContext<'_>
pub fn prepare_container(&self) -> PrepareContainerContext<'_>
Prepares a new container with the image from the integration test.
This will not create nor run the container immediately. Use the returned
PrepareContainerContext
to configure the container, then call
start_with_default_process
on it
to actually create and start the container.
Example:
use libcnb_test::IntegrationTest;
IntegrationTest::new("heroku/buildpacks:20", "test-fixtures/empty-app").run_test(|context| {
context.prepare_container().start_with_default_process(|container| {
// ...
});
});
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for IntegrationTestContext<'a>
impl<'a> Send for IntegrationTestContext<'a>
impl<'a> Sync for IntegrationTestContext<'a>
impl<'a> Unpin for IntegrationTestContext<'a>
impl<'a> !UnwindSafe for IntegrationTestContext<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more