diff --git a/Cargo.lock b/Cargo.lock index 31086ef285..a7a0b7731e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -234,7 +234,7 @@ dependencies = [ "chrono", "chrono-tz", "half 2.3.1", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "num", ] @@ -396,7 +396,7 @@ dependencies = [ "arrow-data", "arrow-schema", "half 2.3.1", - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -471,9 +471,9 @@ dependencies = [ [[package]] name = "async-graphql" -version = "6.0.10" +version = "6.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a665c228a226506796fca6de90cf1ad477157513ee15d6327bf810d5a3a98f72" +checksum = "298a5d587d6e6fdb271bf56af2dc325a80eb291fd0fc979146584b9a05494a8c" dependencies = [ "async-graphql-derive", "async-graphql-parser", @@ -506,9 +506,9 @@ dependencies = [ [[package]] name = "async-graphql-axum" -version = "6.0.10" +version = "6.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0f743cae5a878edf00b6aa59479241310e9341345262e952e9c9e071eb3384" +checksum = "01a1c20a2059bffbc95130715b23435a05168c518fba9709c81fa2a38eed990c" dependencies = [ "async-graphql", "async-trait", @@ -524,9 +524,9 @@ dependencies = [ [[package]] name = "async-graphql-derive" -version = "6.0.10" +version = "6.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f04964faf9ad71289d4c51b3b43a7b9c01c23c16d9c52bca48161ba8a3cbc3" +checksum = "c7f329c7eb9b646a72f70c9c4b516c70867d356ec46cb00dcac8ad343fd006b0" dependencies = [ "Inflector", "async-graphql-parser", @@ -541,9 +541,9 @@ dependencies = [ [[package]] name = "async-graphql-parser" -version = "6.0.10" +version = "6.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786a2329756a9946d83106e389a977a808ab22628cb797c1afcf174fd01c40d5" +checksum = "6139181845757fd6a73fbb8839f3d036d7150b798db0e9bb3c6e83cdd65bd53b" dependencies = [ "async-graphql-value", "pest", @@ -553,9 +553,9 @@ dependencies = [ [[package]] name = "async-graphql-value" -version = "6.0.10" +version = "6.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305ca1e36538655babbfa8a9a1d82cb1dd01961af2feeafa06d3a0c9af793bed" +checksum = "323a5143f5bdd2030f45e3f2e0c821c9b1d36e79cf382129c64299c50a7f3750" dependencies = [ "bytes", "indexmap 2.1.0", @@ -1808,7 +1808,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "lock_api", "once_cell", "parking_lot_core", @@ -1816,9 +1816,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "datafusion" @@ -1847,7 +1847,7 @@ dependencies = [ "futures", "glob", "half 2.3.1", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "indexmap 2.1.0", "itertools 0.11.0", "log", @@ -1898,7 +1898,7 @@ dependencies = [ "datafusion-common", "datafusion-expr", "futures", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "log", "object_store", "parking_lot", @@ -1934,7 +1934,7 @@ dependencies = [ "datafusion-common", "datafusion-expr", "datafusion-physical-expr", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "itertools 0.11.0", "log", "regex-syntax 0.8.2", @@ -1959,7 +1959,7 @@ dependencies = [ "datafusion-common", "datafusion-expr", "half 2.3.1", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "hex", "indexmap 2.1.0", "itertools 0.11.0", @@ -1994,7 +1994,7 @@ dependencies = [ "datafusion-physical-expr", "futures", "half 2.3.1", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "indexmap 2.1.0", "itertools 0.11.0", "log", @@ -2445,9 +2445,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -2610,9 +2610,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -2689,9 +2689,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -2914,6 +2914,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "impl-trait-for-tuples" version = "0.2.2" @@ -2977,7 +2987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "serde", ] @@ -4311,9 +4321,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.95" +version = "0.9.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" +checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" dependencies = [ "cc", "libc", @@ -4428,7 +4438,7 @@ dependencies = [ "chrono", "flate2", "futures", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "lz4_flex", "num", "num-bigint", @@ -4498,9 +4508,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" @@ -4832,18 +4842,18 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5a410fc7882af66deb8d01d01737353cf3ad6204c408177ba494291a626312" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", "prost-derive", @@ -4851,9 +4861,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065717a5dfaca4a83d2fe57db3487b311365200000551d7a364e715dbf4346bc" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", "itertools 0.11.0", @@ -5183,9 +5193,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.24" +version = "0.38.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" dependencies = [ "bitflags 2.4.1", "errno", @@ -5334,18 +5344,18 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", @@ -5886,18 +5896,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", @@ -6337,7 +6347,7 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna", + "idna 0.4.0", "ipnet", "once_cell", "rand", @@ -6491,12 +6501,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", "serde", ] @@ -6521,9 +6531,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ "getrandom", ] @@ -6697,9 +6707,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "whoami" diff --git a/src/adapter/http/tests/harness/server_side_s3_harness.rs b/src/adapter/http/tests/harness/server_side_s3_harness.rs index 3bca58f606..1421d048fe 100644 --- a/src/adapter/http/tests/harness/server_side_s3_harness.rs +++ b/src/adapter/http/tests/harness/server_side_s3_harness.rs @@ -15,7 +15,6 @@ use std::sync::Arc; use event_bus::EventBus; use kamu::domain::{ auth, - CurrentAccountSubject, DatasetRepository, InternalError, ResultIntoInternal, diff --git a/src/infra/core/tests/tests/engine/test_engine_transform.rs b/src/infra/core/tests/tests/engine/test_engine_transform.rs index ab87479c33..ddbeef84e9 100644 --- a/src/infra/core/tests/tests/engine/test_engine_transform.rs +++ b/src/infra/core/tests/tests/engine/test_engine_transform.rs @@ -264,7 +264,7 @@ async fn test_transform_common(transform: Transform) { .with_cache_dir(cache_dir) .with_run_info_dir(run_info_dir) .with_container_runtime(Arc::new(ContainerRuntime::default())) - .with_data_format_registory(Arc::new(dataFormatRegistryImpl::new())) + .with_data_format_registry(Arc::new(DataFormatRegistryImpl::new())) ) .bind::() .add::() @@ -274,7 +274,7 @@ async fn test_transform_common(transform: Transform) { .build(); let dataset_repo = catalog.get_one::().unwrap(); - let ingest_svc = catalog.get_one::().unwrap(); + let ingest_svc = catalog.get_one::().unwrap(); let transform_svc = catalog.get_one::().unwrap(); /////////////////////////////////////////////////////////////////////////// diff --git a/src/infra/core/tests/tests/ingest/test_polling_ingest.rs b/src/infra/core/tests/tests/ingest/test_polling_ingest.rs index 6b0e52bf91..e8158b9074 100644 --- a/src/infra/core/tests/tests/ingest/test_polling_ingest.rs +++ b/src/infra/core/tests/tests/ingest/test_polling_ingest.rs @@ -14,12 +14,9 @@ use chrono::{TimeZone, Utc}; use container_runtime::ContainerRuntime; use datafusion::parquet::record::RowAccessor; use datafusion::prelude::*; -use domain::auth::DatasetActionAuthorizer; use event_bus::EventBus; -use futures::StreamExt; use indoc::indoc; use itertools::Itertools; -use kamu::domain::auth::DatasetActionAuthorizer; use kamu::domain::*; use kamu::testing::*; use kamu::*; @@ -1010,8 +1007,8 @@ async fn test_ingest_checks_auth() { struct IngestTestHarness { temp_dir: TempDir, dataset_repo: Arc, - ingest_svc: Arc, - time_source: Arc, + ingest_svc: Arc, + time_source: Arc, ctx: SessionContext, } @@ -1020,7 +1017,7 @@ impl IngestTestHarness { Self::new_with_authorizer(kamu_core::auth::AlwaysHappyDatasetActionAuthorizer::new()) } - fn new_with_authorizer( + fn new_with_authorizer( dataset_action_authorizer: TDatasetAuthorizer, ) -> Self { let temp_dir = tempfile::tempdir().unwrap(); @@ -1033,7 +1030,7 @@ impl IngestTestHarness { .add::() .add_value(CurrentAccountSubject::new_test()) .add_value(dataset_action_authorizer) - .bind::() + .bind::() .add_builder( dill::builder_for::() .with_root(temp_dir.path().join("datasets")) @@ -1061,11 +1058,11 @@ impl IngestTestHarness { .with_data_format_registry(Arc::new(DataFormatRegistryImpl::new())) .with_run_info_dir(run_info_dir), ) - .bind::() + .bind::() .build(); let dataset_repo = catalog.get_one::().unwrap(); - let ingest_svc = catalog.get_one::().unwrap(); + let ingest_svc = catalog.get_one::().unwrap(); let time_source = catalog.get_one::().unwrap(); Self { diff --git a/src/infra/core/tests/tests/ingest/test_push_ingest.rs b/src/infra/core/tests/tests/ingest/test_push_ingest.rs index b7df3e0252..509c7a9562 100644 --- a/src/infra/core/tests/tests/ingest/test_push_ingest.rs +++ b/src/infra/core/tests/tests/ingest/test_push_ingest.rs @@ -11,8 +11,8 @@ use std::sync::Arc; use chrono::{TimeZone, Utc}; use datafusion::prelude::*; +use event_bus::EventBus; use indoc::indoc; -use kamu::domain::auth::DatasetActionAuthorizer; use kamu::domain::*; use kamu::testing::*; use kamu::*; @@ -381,49 +381,53 @@ async fn test_ingest_push_media_type_override() { struct IngestTestHarness { temp_dir: TempDir, - dataset_repo: Arc, - push_ingest_svc: Arc, + dataset_repo: Arc, + push_ingest_svc: Arc, ctx: SessionContext, } impl IngestTestHarness { fn new() -> Self { - Self::new_with_authorizer(Arc::new( - kamu_core::auth::AlwaysHappyDatasetActionAuthorizer::new(), - )) + Self::new_with_authorizer(kamu_core::auth::AlwaysHappyDatasetActionAuthorizer::new()) } - fn new_with_authorizer(dataset_action_authorizer: Arc) -> Self { + fn new_with_authorizer( + dataset_action_authorizer: TDatasetAuthorizer, + ) -> Self { let temp_dir = tempfile::tempdir().unwrap(); let run_info_dir = temp_dir.path().join("run"); let cache_dir = temp_dir.path().join("cache"); std::fs::create_dir(&run_info_dir).unwrap(); std::fs::create_dir(&cache_dir).unwrap(); - let dataset_repo = Arc::new( - DatasetRepositoryLocalFs::create( - temp_dir.path().join("datasets"), - Arc::new(CurrentAccountSubject::new_test()), - dataset_action_authorizer.clone(), - false, + let catalog = dill::CatalogBuilder::new() + .add::() + .add_value(CurrentAccountSubject::new_test()) + .add_value(dataset_action_authorizer) + .bind::() + .add_builder( + dill::builder_for::() + .with_root(temp_dir.path().join("datasets")) + .with_multi_tenant(false), + ) + .bind::() + .add_value(SystemTimeSourceStub::new_set( + Utc.with_ymd_and_hms(2050, 1, 1, 12, 0, 0).unwrap(), + )) + .bind::() + .add_builder( + dill::builder_for::() + .with_object_store_registry(Arc::new(ObjectStoreRegistryImpl::new(vec![ + Arc::new(ObjectStoreBuilderLocalFs::new()), + ]))) + .with_data_format_registry(Arc::new(DataFormatRegistryImpl::new())) + .with_run_info_dir(run_info_dir), ) - .unwrap(), - ); - - let time_source = Arc::new(SystemTimeSourceStub::new_set( - Utc.with_ymd_and_hms(2050, 1, 1, 12, 0, 0).unwrap(), - )); - - let push_ingest_svc = Arc::new(PushIngestServiceImpl::new( - dataset_repo.clone(), - dataset_action_authorizer, - Arc::new(ObjectStoreRegistryImpl::new(vec![Arc::new( - ObjectStoreBuilderLocalFs::new(), - )])), - Arc::new(DataFormatRegistryImpl::new()), - run_info_dir, - time_source, - )); + .bind::() + .build(); + + let dataset_repo = catalog.get_one::().unwrap(); + let push_ingest_svc = catalog.get_one::().unwrap(); Self { temp_dir, diff --git a/src/infra/core/tests/tests/test_pull_service_impl.rs b/src/infra/core/tests/tests/test_pull_service_impl.rs index 9bf6229705..e119083c28 100644 --- a/src/infra/core/tests/tests/test_pull_service_impl.rs +++ b/src/infra/core/tests/tests/test_pull_service_impl.rs @@ -937,7 +937,7 @@ impl PullTestHarness { .add::() .bind::() .add_value(TestIngestService::new(calls.clone())) - .bind::() + .bind::() .add_value(TestTransformService::new(calls.clone())) .bind::() .add_builder(dill::builder_for::().with_calls(calls.clone())) diff --git a/src/infra/task-system-inmem/tests/tests/test_task_scheduler_inmem.rs b/src/infra/task-system-inmem/tests/tests/test_task_scheduler_inmem.rs index c1a774dc9d..e8440a8a17 100644 --- a/src/infra/task-system-inmem/tests/tests/test_task_scheduler_inmem.rs +++ b/src/infra/task-system-inmem/tests/tests/test_task_scheduler_inmem.rs @@ -18,7 +18,7 @@ use kamu_task_system_inmem::*; #[test_log::test(tokio::test)] async fn test_creates_task() { let event_store = Arc::new(TaskSystemEventStoreInMemory::new()); - let time_source = Arc::new(SystemTimeSourceStub::new(Utc::now())); + let time_source = Arc::new(SystemTimeSourceStub::new_set(Utc::now())); let task_sched = TaskSchedulerInMemory::new(event_store, time_source); let logical_plan_expected: LogicalPlan = Probe { ..Probe::default() }.into(); @@ -43,7 +43,7 @@ async fn test_creates_task() { #[test_log::test(tokio::test)] async fn test_queues_tasks() { let event_store = Arc::new(TaskSystemEventStoreInMemory::new()); - let time_source = Arc::new(SystemTimeSourceStub::new(Utc::now())); + let time_source = Arc::new(SystemTimeSourceStub::new_set(Utc::now())); let task_sched = TaskSchedulerInMemory::new(event_store, time_source); let task_id_1 = task_sched @@ -66,7 +66,7 @@ async fn test_queues_tasks() { #[test_log::test(tokio::test)] async fn test_task_cancellation() { let event_store = Arc::new(TaskSystemEventStoreInMemory::new()); - let time_source = Arc::new(SystemTimeSourceStub::new(Utc::now())); + let time_source = Arc::new(SystemTimeSourceStub::new_set(Utc::now())); let task_sched = TaskSchedulerInMemory::new(event_store, time_source); let task_id_1 = task_sched