Skip to content

Commit

Permalink
Add integration test for argument overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlewis committed Feb 21, 2024
1 parent bd978e2 commit abe484e
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#![allow(unused_crate_dependencies)]

use indoc::indoc;
use libcnb_test::{assert_contains, BuildConfig, ContainerConfig, PackResult, TestRunner};
use libcnb_test::{
assert_contains, assert_empty, BuildConfig, ContainerConfig, PackResult, TestRunner,
};

#[test]
#[ignore = "integration test"]
Expand Down Expand Up @@ -162,3 +164,39 @@ fn test_missing_procfile() {
},
);
}

#[test]
#[ignore = "integration test"]
fn test_process_overrides() {
TestRunner::default().build(
BuildConfig::new(
"heroku/builder:22",
"tests/fixtures/web_and_worker_procfile",
),
|context| {
// Test that the default process command can be overridden.
// i.e.: `docker run myapp "echo foo"`
context.start_container(
ContainerConfig::new().command(["echo 'default process overridden!'"]),
|container| {
let all_log_output = container.logs_wait();
assert_empty!(all_log_output.stderr);
assert_eq!(all_log_output.stdout, "default process overridden!\n");
},
);

// Test that a named process can be overridden.
// i.e.: `docker run --entrypoint worker myapp "echo foo"`
context.start_container(
ContainerConfig::new()
.entrypoint("worker")
.command(["echo 'worker process overridden!'"]),
|container| {
let all_log_output = container.logs_wait();
assert_empty!(all_log_output.stderr);
assert_eq!(all_log_output.stdout, "worker process overridden!\n");
},
);
},
);
}

0 comments on commit abe484e

Please sign in to comment.