diff --git a/buildpacks/release-phase/tests/integration_test.rs b/buildpacks/release-phase/tests/integration_test.rs index 43ff492..9475505 100644 --- a/buildpacks/release-phase/tests/integration_test.rs +++ b/buildpacks/release-phase/tests/integration_test.rs @@ -1,7 +1,7 @@ // Required due to: https://github.com/rust-lang/rust/issues/95513 #![allow(unused_crate_dependencies)] -use std::{env, path::Path}; +use std::{env, fs, path::Path}; use libcnb_test::{assert_contains, ContainerConfig}; use tempfile::tempdir; @@ -72,12 +72,15 @@ fn project_uses_release_build_and_web_process_loads_artifacts() { let maybe_github_runner_temp_dir = env::var("RUNNER_TEMP"); let temp_dir = tempdir().expect("should create temporary directory for artifact storage"); + let temp_sub_dir = "static-artifacts-storage"; let local_storage_path = if let Ok(github_runner_temp_dir) = &maybe_github_runner_temp_dir { - Path::new(github_runner_temp_dir) + Path::new(github_runner_temp_dir).join(temp_sub_dir) } else { - temp_dir.path() + temp_dir.path().join(temp_sub_dir) }; + fs::create_dir_all(&local_storage_path) + .expect("local_storage_path directory should be created"); let container_volume_path = "/static-artifacts-storage"; let container_volume_url = "file://".to_owned() + container_volume_path; println!("local_storage_path: {local_storage_path:?}"); @@ -91,7 +94,7 @@ fn project_uses_release_build_and_web_process_loads_artifacts() { ContainerConfig::new() .env("RELEASE_ID", unique) .env("STATIC_ARTIFACTS_URL", &container_volume_url) - .bind_mount(local_storage_path, container_volume_path), + .bind_mount(&local_storage_path, container_volume_path), &"release".to_string(), |container| { let log_output = container.logs_now(); @@ -110,7 +113,7 @@ fn project_uses_release_build_and_web_process_loads_artifacts() { ContainerConfig::new() .env("RELEASE_ID", unique) .env("STATIC_ARTIFACTS_URL", &container_volume_url) - .bind_mount(local_storage_path, container_volume_path), + .bind_mount(&local_storage_path, container_volume_path), &"web".to_string(), |container| { let log_output = container.logs_now();