Unified · Split
| @@ -102,6 +102,7 @@ check: ## Build all code in suitable configurations · 101 unmodified lines | |||
| 102 | unit-tests: ## run all unit tests | 102 | unit-tests: ## run all unit tests |
| 103 | cargo test --all --no-fail-fast | 103 | cargo test --all --no-fail-fast |
| 104 | cd git-features && cargo test && cargo test --all-features | 104 | cd git-features && cargo test && cargo test --all-features |
| 105 | cd git-odb && cargo test && cargo test --all-features | ||
| 105 | cd git-transport && cargo test && cargo test --features http-client-curl | 106 | cd git-transport && cargo test && cargo test --features http-client-curl |
| 106 | cd gitoxide-core && cargo test --lib | 107 | cd gitoxide-core && cargo test --lib |
| 107 | 108 | ||
| @@ -160,7 +160,7 @@ pub mod reduce { · 159 unmodified lines | |||
| 160 | }; | 160 | }; |
| 161 | } | 161 | } |
| 162 | if let Some(thread_err) = last_err { | 162 | if let Some(thread_err) = last_err { |
| 163 | std::panic::panic_any(thread_err); | 163 | std::panic::resume_unwind(thread_err); |
| 164 | } | 164 | } |
| 165 | } | 165 | } |
| 166 | } | 166 | } |
| @@ -16,6 +16,17 @@ default = ["flate2/zlib-ng-compat"] · 15 unmodified lines | |||
| 16 | pack-cache-lru-static = ["uluru"] | 16 | pack-cache-lru-static = ["uluru"] |
| 17 | pack-cache-lru-dynamic = ["memory-lru"] | 17 | pack-cache-lru-dynamic = ["memory-lru"] |
| 18 | serde1 = ["serde", "git-object/serde1"] | 18 | serde1 = ["serde", "git-object/serde1"] |
| 19 | internal-testing-git-features-parallel = ["git-features/parallel"] | ||
| 20 | |||
| 21 | [[test]] | ||
| 22 | name = "multi-threaded-odb" | ||
| 23 | path = "tests/odb.rs" | ||
| 24 | required-features = ["internal-testing-git-features-parallel"] | ||
| 25 | |||
| 26 | [[test]] | ||
| 27 | name = "single-threaded-odb" | ||
| 28 | path = "tests/odb.rs" | ||
| 29 | required-features = [] | ||
| 19 | 30 | ||
| 20 | [package.metadata.docs.rs] | 31 | [package.metadata.docs.rs] |
| 21 | all-features = true | 32 | all-features = true |
| @@ -115,6 +115,8 @@ where · 114 unmodified lines | |||
| 115 | move |oid, (buf, cache)| { | 115 | move |oid, (buf, cache)| { |
| 116 | let _obj = db.locate(oid.as_ref(), buf, cache)?; | 116 | let _obj = db.locate(oid.as_ref(), buf, cache)?; |
| 117 | let _ = version; // currently unused | 117 | let _ = version; // currently unused |
| 118 | todo!("entry generation"); | ||
| 119 | #[allow(unreachable_code)] | ||
| 118 | Ok(Vec::new()) | 120 | Ok(Vec::new()) |
| 119 | }, | 121 | }, |
| 120 | parallel::reduce::IdentityWithResult::default(), | 122 | parallel::reduce::IdentityWithResult::default(), |
| @@ -17,23 +17,27 @@ mod simple_compression { · 16 unmodified lines | |||
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | #[test] | 19 | #[test] |
| 20 | fn all_input_objects() -> crate::Result { | 20 | #[should_panic] |
| 21 | let db = db(DbKind::AbunchOfRandomObjects)?; | 21 | fn all_input_objects() { |
| 22 | let obj_count = db.iter().count(); | 22 | (|| -> Result<(), Box<dyn std::error::Error>> { |
| 23 | assert_eq!(obj_count, 146); | 23 | let db = db(DbKind::AbunchOfRandomObjects)?; |
| 24 | let all_objects = db.arc_iter().flat_map(Result::ok); | 24 | let obj_count = db.iter().count(); |
| 25 | let entries: Vec<_> = pack::data::encode::entries( | 25 | assert_eq!(obj_count, 146); |
| 26 | db.clone(), | 26 | let all_objects = db.arc_iter().flat_map(Result::ok); |
| 27 | all_objects, | 27 | let entries: Vec<_> = pack::data::encode::entries( |
| 28 | progress::Discard, | 28 | db.clone(), |
| 29 | pack::data::encode::Options::default(), | 29 | all_objects, |
| 30 | ) | 30 | progress::Discard, |
| 31 | .collect::<Result<Vec<_>, _>>()? | 31 | pack::data::encode::Options::default(), |
| 32 | .into_iter() | 32 | ) |
| 33 | .flatten() | 33 | .collect::<Result<Vec<_>, _>>()? |
| 34 | .collect(); | 34 | .into_iter() |
| 35 | // assert_eq!(entries.len(), obj_count, "each object gets one entry"); | 35 | .flatten() |
| 36 | assert_eq!(entries.len(), 0, "each object gets one entry"); | 36 | .collect(); |
| 37 | Ok(()) | 37 | // assert_eq!(entries.len(), obj_count, "each object gets one entry"); |
| 38 | assert_eq!(entries.len(), 0, "each object gets one entry"); | ||
| 39 | Ok(()) | ||
| 40 | })() | ||
| 41 | .unwrap(); | ||
| 38 | } | 42 | } |
| 39 | } | 43 | } |