Skip to content

Commit

Permalink
feat!: update to fluence-app-service 0.35.0 (#121)
Browse files Browse the repository at this point in the history
update to fluence-app-service 0.35.0
  • Loading branch information
ValeryAntopol authored Feb 22, 2024
1 parent ba2c87b commit eebcac8
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 69 deletions.
76 changes: 55 additions & 21 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trybuild = "1.0"
[dependencies]
marine-test-macro = { path = "crates/marine-test-macro", version = "=0.15.0" }
marine-build-rs-generator = { path = "crates/marine-build-rs-generator", version = "=0.15.0" }
fluence-app-service = { version = "0.34.0", features = ["raw-module-api"] }
fluence-app-service = { version = "0.35.0", features = ["raw-module-api"] }

serde = { version = "1.0.162", features = ["derive"] }
serde_json = "1.0.96"
Expand Down
2 changes: 1 addition & 1 deletion crates/marine-test-macro-impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ license = "Apache-2.0"
all-features = true

[dependencies]
fluence-app-service = { version = "0.34.0", features = ["raw-module-api"] }
fluence-app-service = { version = "0.35.0", features = ["raw-module-api"] }
marine-it-parser = "0.15.0"
itertools = "0.10.5"
darling = "0.20.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ pub(crate) fn generate_app_service_ctor(
.ok_or_else(|| TestGeneratorError::InvalidUTF8Path(test_file_path.to_path_buf()))?;

let service_ctor = quote! {
let tmp_dir = std::env::temp_dir();
let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string();

let tmp_dir = tmp_dir.join(&service_id);
let tmp_dir = tmp_dir.to_string_lossy().to_string();
std::fs::create_dir(&tmp_dir).expect("can't create a directory for service in tmp");

let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let mut file_path = std::path::Path::new(#test_file_path).components();

Expand Down Expand Up @@ -59,7 +53,6 @@ pub(crate) fn generate_app_service_ctor(
.unwrap_or_else(|e| {
panic!("app service config located at `{:?}` can't be loaded: {}", config_path, e)
} );
__m_generated_marine_config.service_base_dir = Some(tmp_dir);
__m_generated_marine_config.toml_marine_config.base_path = config_path
.parent()
.map(std::path::PathBuf::from)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ fn empty_string() {
impl ModuleInterface {}
}
}
let tmp_dir = std::env::temp_dir();
let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string();
let tmp_dir = tmp_dir.join(&service_id);
let tmp_dir = tmp_dir.to_string_lossy().to_string();
std::fs::create_dir(&tmp_dir).expect("can't create a directory for service in tmp");
let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let mut file_path = std::path::Path::new("tests/generation_tests/empty_func").components();
let mut truncated_file_path = Vec::new();
Expand Down Expand Up @@ -111,7 +107,6 @@ fn empty_string() {
config_path, e
)
});
__m_generated_marine_config.service_base_dir = Some(tmp_dir);
__m_generated_marine_config.toml_marine_config.base_path = config_path
.parent()
.map(std::path::PathBuf::from)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ fn test() {
}
}
}
let tmp_dir = std::env::temp_dir();
let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string();
let tmp_dir = tmp_dir.join(&service_id);
let tmp_dir = tmp_dir.to_string_lossy().to_string();
std::fs::create_dir(&tmp_dir).expect("can't create a directory for service in tmp");
let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let mut file_path = std::path::Path::new("tests/generation_tests/mounted_binary").components();
let mut truncated_file_path = Vec::new();
Expand Down Expand Up @@ -142,7 +138,6 @@ fn test() {
config_path, e
)
});
__m_generated_marine_config.service_base_dir = Some(tmp_dir);
__m_generated_marine_config.toml_marine_config.base_path = config_path
.parent()
.map(std::path::PathBuf::from)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,7 @@ pub mod tests {
}
impl ServiceInterface {
pub fn new() -> Self {
let tmp_dir = std::env::temp_dir();
let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string();
let tmp_dir = tmp_dir.join(&service_id);
let tmp_dir = tmp_dir.to_string_lossy().to_string();
std::fs::create_dir(&tmp_dir)
.expect("can't create a directory for service in tmp");
let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let mut file_path =
std::path::Path::new("tests/generation_tests/multi-service-empty_mod")
Expand Down Expand Up @@ -213,7 +208,7 @@ pub mod tests {
config_path, e
)
});
__m_generated_marine_config.service_base_dir = Some(tmp_dir);

__m_generated_marine_config.toml_marine_config.base_path = config_path
.parent()
.map(std::path::PathBuf::from)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,7 @@ fn test() {
}
impl ServiceInterface {
pub fn new() -> Self {
let tmp_dir = std::env::temp_dir();
let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string();
let tmp_dir = tmp_dir.join(&service_id);
let tmp_dir = tmp_dir.to_string_lossy().to_string();
std::fs::create_dir(&tmp_dir)
.expect("can't create a directory for service in tmp");
let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let mut file_path =
std::path::Path::new("tests/generation_tests/multi-service-multiple")
Expand Down Expand Up @@ -213,7 +208,6 @@ fn test() {
config_path, e
)
});
__m_generated_marine_config.service_base_dir = Some(tmp_dir);
__m_generated_marine_config.toml_marine_config.base_path = config_path
.parent()
.map(std::path::PathBuf::from)
Expand Down Expand Up @@ -416,12 +410,7 @@ fn test() {
}
impl ServiceInterface {
pub fn new() -> Self {
let tmp_dir = std::env::temp_dir();
let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string();
let tmp_dir = tmp_dir.join(&service_id);
let tmp_dir = tmp_dir.to_string_lossy().to_string();
std::fs::create_dir(&tmp_dir)
.expect("can't create a directory for service in tmp");
let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let mut file_path =
std::path::Path::new("tests/generation_tests/multi-service-multiple")
Expand Down Expand Up @@ -456,7 +445,6 @@ fn test() {
config_path, e
)
});
__m_generated_marine_config.service_base_dir = Some(tmp_dir);
__m_generated_marine_config.toml_marine_config.base_path = config_path
.parent()
.map(std::path::PathBuf::from)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,7 @@ fn empty_test() {
}
impl ServiceInterface {
pub fn new() -> Self {
let tmp_dir = std::env::temp_dir();
let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string();
let tmp_dir = tmp_dir.join(&service_id);
let tmp_dir = tmp_dir.to_string_lossy().to_string();
std::fs::create_dir(&tmp_dir)
.expect("can't create a directory for service in tmp");
let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let mut file_path =
std::path::Path::new("tests/generation_tests/multi-service-single")
Expand Down Expand Up @@ -213,7 +208,6 @@ fn empty_test() {
config_path, e
)
});
__m_generated_marine_config.service_base_dir = Some(tmp_dir);
__m_generated_marine_config.toml_marine_config.base_path = config_path
.parent()
.map(std::path::PathBuf::from)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,7 @@ fn empty_string() {
}
}
}
let tmp_dir = std::env::temp_dir();
let service_id = marine_rs_sdk_test::internal::Uuid::new_v4().to_string();
let tmp_dir = tmp_dir.join(&service_id);
let tmp_dir = tmp_dir.to_string_lossy().to_string();
std::fs::create_dir(&tmp_dir).expect("can't create a directory for service in tmp");
let mut module_path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let mut file_path =
std::path::Path::new("tests/generation_tests/multiple_modules").components();
Expand Down Expand Up @@ -263,7 +259,6 @@ fn empty_string() {
config_path, e
)
});
__m_generated_marine_config.service_base_dir = Some(tmp_dir);
__m_generated_marine_config.toml_marine_config.base_path = config_path
.parent()
.map(std::path::PathBuf::from)
Expand Down

0 comments on commit eebcac8

Please sign in to comment.