Skip to content

Commit

Permalink
Use proposed libcnb-test volume config approach
Browse files Browse the repository at this point in the history
  • Loading branch information
runesoerensen committed Oct 21, 2024
1 parent 9a92682 commit 7116b3e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions buildpacks/release-phase/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition.workspace = true
workspace = true

[dependencies]
libcnb = { git = "https://github.com/mars/libcnb.rs.git", branch = "docker-volume" }
libcnb = { git = "https://github.com/heroku/libcnb.rs.git", branch = "support-docker-volume-mounts" }
commons_ruby = { git = "https://github.com/heroku/buildpacks-ruby", branch = "main", package = "commons" }
libherokubuildpack = { version = "=0.22.0", default-features = false, features = ["fs", "log"] }
indoc = "2"
Expand All @@ -17,7 +17,7 @@ tokio = { version = "1.40.0", features = ["macros", "rt-multi-thread"] }
toml = { version = "0.8", features = ["preserve_order"] }

[dev-dependencies]
libcnb-test = { git = "https://github.com/mars/libcnb.rs.git", branch = "docker-volume" }
libcnb-test = { git = "https://github.com/heroku/libcnb.rs.git", branch = "support-docker-volume-mounts" }
tempfile = "3"
test_support.workspace = true
uuid = { version = "1.10.0", features = ["v4", "serde"] }
12 changes: 6 additions & 6 deletions buildpacks/release-phase/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![allow(unused_crate_dependencies)]

use libcnb_test::{assert_contains, ContainerConfig};
use std::path::PathBuf;
use tempfile::tempdir;
use test_support::{
release_phase_and_procfile_integration_test, release_phase_integration_test,
Expand Down Expand Up @@ -68,10 +69,9 @@ fn project_uses_release_build_and_web_process_loads_artifacts() {
|ctx| {
let unique = Uuid::new_v4();
let local_storage_tmp_dir = tempdir().unwrap();
let local_storage_path = local_storage_tmp_dir.path().to_str().unwrap();
let container_volume_path = "/static-artifacts-storage";
let container_volume_url = "file://".to_owned() + container_volume_path;
let volume = local_storage_path.to_owned() + ":" + container_volume_path;
let container_volume_path = PathBuf::from("/static-artifacts-storage");
let container_volume_url =
format!("file://{}", &container_volume_path.to_string_lossy());

assert_contains!(ctx.pack_stdout, "Procfile");
assert_contains!(ctx.pack_stdout, "Release Phase");
Expand All @@ -81,7 +81,7 @@ fn project_uses_release_build_and_web_process_loads_artifacts() {
ContainerConfig::new()
.env("RELEASE_ID", unique)
.env("STATIC_ARTIFACTS_URL", &container_volume_url)
.volumes([volume.clone()]),
.volume(&local_storage_tmp_dir, &container_volume_path),
&"release".to_string(),
|container| {
let log_output = container.logs_now();
Expand All @@ -100,7 +100,7 @@ fn project_uses_release_build_and_web_process_loads_artifacts() {
ContainerConfig::new()
.env("RELEASE_ID", unique)
.env("STATIC_ARTIFACTS_URL", &container_volume_url)
.volumes([volume.clone()]),
.volume(&local_storage_tmp_dir, &container_volume_path),
&"web".to_string(),
|container| {
let log_output = container.logs_now();
Expand Down
2 changes: 1 addition & 1 deletion common/release_commands/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition.workspace = true
workspace = true

[dependencies]
libcnb = { git = "https://github.com/mars/libcnb.rs.git", branch = "docker-volume" }
libcnb = { git = "https://github.com/heroku/libcnb.rs.git", branch = "support-docker-volume-mounts" }
libherokubuildpack = { version = "=0.22.0", default-features = false, features = ["toml"] }
serde = "1"
toml = { version = "0.8", features = ["preserve_order"] }
4 changes: 2 additions & 2 deletions test_support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition.workspace = true
workspace = true

[dependencies]
libcnb = { git = "https://github.com/mars/libcnb.rs.git", branch = "docker-volume" }
libcnb-test = { git = "https://github.com/mars/libcnb.rs.git", branch = "docker-volume" }
libcnb = { git = "https://github.com/heroku/libcnb.rs.git", branch = "support-docker-volume-mounts" }
libcnb-test = { git = "https://github.com/heroku/libcnb.rs.git", branch = "support-docker-volume-mounts" }
ureq = "2"

0 comments on commit 7116b3e

Please sign in to comment.