Skip to content

Commit

Permalink
Log when we're skipping process detection
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlewis committed Dec 12, 2024
1 parent 586dc16 commit 1935d9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions buildpacks/go/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ impl Buildpack for GoBuildpack {
cmd::go_install(&packages, &go_env).map_err(GoBuildpackError::GoBuild)?;

let mut procs: Vec<Process> = vec![];
if !Path::exists(&context.app_dir.join("Procfile")) {
log_header("Setting launch table");
if Path::exists(&context.app_dir.join("Procfile")) {
log_info("Skipping launch process registration (Procfile detected)");
} else {
log_header("Registering launch processes");
procs = proc::build_procs(&packages).map_err(GoBuildpackError::Proc)?;
log_info("Detected processes:");
for proc in &procs {
Expand Down
5 changes: 3 additions & 2 deletions buildpacks/go/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ fn test_worker_http_118() {
&[
"Detected Go version requirement: ~1.18.1",
"Installing go1.18.",
"Detected processes",
"Detected processes:",
"example.com/worker_http_118/cmd/web",
"example.com/worker_http_118/cmd/worker",
],
Expand Down Expand Up @@ -149,7 +149,8 @@ fn test_procfile_http_123() {
TestRunner::default().build(build_config, |ctx| {
assert_contains!(ctx.pack_stdout, "Detected Go version requirement: =1.23");
assert_contains!(ctx.pack_stdout, "Installing go1.23.");
assert_not_contains!(ctx.pack_stdout, "Setting launch table");
assert_contains!(ctx.pack_stdout, "Skipping launch process registration");
assert_not_contains!(ctx.pack_stdout, "Registering launch processes");
assert_not_contains!(ctx.pack_stdout, "Detected processes:");
});
}
Expand Down

0 comments on commit 1935d9c

Please sign in to comment.