-
Notifications
You must be signed in to change notification settings - Fork 115
Fix all test cases, add files for test cases in LFS #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| tests/data/packs/* filter=lfs diff=lfs merge=lfs -text | ||
| *.pack filter=lfs diff=lfs merge=lfs -text | ||
| 20de184187340e8b98da0fa14685b6a3e5c638ba2cf6b7b193b17c0ee1da38e8 filter=lfs diff=lfs merge=lfs -text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| Cargo.lock | ||
| target/ | ||
| .cache_temp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -706,11 +706,8 @@ mod tests { | |||||
|
|
||||||
| #[tokio::test] | ||||||
| async fn test_pack_check_header() { | ||||||
| let res = crate::test_utils::setup_lfs_file().await; | ||||||
| println!("{res:?}"); | ||||||
| let source = res | ||||||
| .get("git-2d187177923cd618a75da6c6db45bb89d92bd504.pack") | ||||||
| .unwrap(); | ||||||
| let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||||||
| source.push("tests/data/packs/git-2d187177923cd618a75da6c6db45bb89d92bd504.pack"); | ||||||
|
|
||||||
| let f = fs::File::open(source).unwrap(); | ||||||
| let mut buf_reader = BufReader::new(f); | ||||||
|
|
@@ -744,7 +741,7 @@ mod tests { | |||||
|
|
||||||
| #[test] | ||||||
| fn test_pack_decode_without_delta() { | ||||||
| let mut source = PathBuf::from(env::current_dir().unwrap().parent().unwrap()); | ||||||
| let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||||||
| source.push("tests/data/packs/pack-1d0e6c14760c956c173ede71cb28f33d921e232f.pack"); | ||||||
|
|
||||||
| let tmp = PathBuf::from("/tmp/.cache_temp"); | ||||||
|
|
@@ -760,7 +757,7 @@ mod tests { | |||||
| fn test_pack_decode_with_ref_delta() { | ||||||
| init_logger(); | ||||||
|
|
||||||
| let mut source = PathBuf::from(env::current_dir().unwrap().parent().unwrap()); | ||||||
| let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||||||
| source.push("tests/data/packs/ref-delta-65d47638aa7cb7c39f1bd1d5011a415439b887a8.pack"); | ||||||
|
|
||||||
| let tmp = PathBuf::from("/tmp/.cache_temp"); | ||||||
|
|
@@ -773,7 +770,7 @@ mod tests { | |||||
|
|
||||||
| #[test] | ||||||
| fn test_pack_decode_no_mem_limit() { | ||||||
| let mut source = PathBuf::from(env::current_dir().unwrap().parent().unwrap()); | ||||||
| let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||||||
| source.push("tests/data/packs/pack-1d0e6c14760c956c173ede71cb28f33d921e232f.pack"); | ||||||
|
|
||||||
| let tmp = PathBuf::from("/tmp/.cache_temp"); | ||||||
|
|
@@ -785,13 +782,10 @@ mod tests { | |||||
| } | ||||||
|
|
||||||
| #[tokio::test] | ||||||
| #[ignore] // Take too long time | ||||||
| async fn test_pack_decode_with_large_file_with_delta_without_ref() { | ||||||
| init_logger(); | ||||||
| let file_map = crate::test_utils::setup_lfs_file().await; | ||||||
| let source = file_map | ||||||
| .get("git-2d187177923cd618a75da6c6db45bb89d92bd504.pack") | ||||||
| .unwrap(); | ||||||
| let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||||||
| source.push("tests/data/packs/git-2d187177923cd618a75da6c6db45bb89d92bd504.pack"); | ||||||
|
|
||||||
| let tmp = PathBuf::from("/tmp/.cache_temp"); | ||||||
|
|
||||||
|
|
@@ -815,10 +809,8 @@ mod tests { | |||||
| #[tokio::test] | ||||||
| async fn test_decode_large_file_stream() { | ||||||
| init_logger(); | ||||||
| let file_map = crate::test_utils::setup_lfs_file().await; | ||||||
| let source = file_map | ||||||
| .get("git-2d187177923cd618a75da6c6db45bb89d92bd504.pack") | ||||||
| .unwrap(); | ||||||
| let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||||||
| source.push("tests/data/packs/git-2d187177923cd618a75da6c6db45bb89d92bd504.pack"); | ||||||
|
|
||||||
| let tmp = PathBuf::from("/tmp/.cache_temp"); | ||||||
| let f = tokio::fs::File::open(source).await.unwrap(); | ||||||
|
|
@@ -850,12 +842,9 @@ mod tests { | |||||
| } | ||||||
|
|
||||||
| #[tokio::test] | ||||||
| #[ignore] // Take too long time, duplicate with `test_decode_large_file_stream` | ||||||
| async fn test_decode_large_file_async() { | ||||||
| let file_map = crate::test_utils::setup_lfs_file().await; | ||||||
| let source = file_map | ||||||
| .get("git-2d187177923cd618a75da6c6db45bb89d92bd504.pack") | ||||||
| .unwrap(); | ||||||
| let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||||||
| source.push("tests/data/packs/git-2d187177923cd618a75da6c6db45bb89d92bd504.pack"); | ||||||
|
|
||||||
| let tmp = PathBuf::from("/tmp/.cache_temp"); | ||||||
| let f = fs::File::open(source).unwrap(); | ||||||
|
|
@@ -870,7 +859,7 @@ mod tests { | |||||
| let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel(); | ||||||
| let handle = p.decode_async(buffered, tx); // new thread | ||||||
| let mut cnt = 0; | ||||||
| while let Ok(_entry) = rx.try_recv() { | ||||||
| while let Some(_entry) = rx.recv().await { | ||||||
| cnt += 1; //use entry here | ||||||
| } | ||||||
| let p = handle.join().unwrap(); | ||||||
|
|
@@ -879,7 +868,7 @@ mod tests { | |||||
|
|
||||||
| #[test] | ||||||
| fn test_pack_decode_with_delta_without_ref() { | ||||||
| let mut source = PathBuf::from(env::current_dir().unwrap().parent().unwrap()); | ||||||
| let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||||||
| source.push("tests/data/packs/pack-d50df695086eea6253a237cb5ac44af1629e7ced.pack"); | ||||||
|
|
||||||
| let tmp = PathBuf::from("/tmp/.cache_temp"); | ||||||
|
|
@@ -890,8 +879,7 @@ mod tests { | |||||
| p.decode(&mut buffered, |_, _| {}).unwrap(); | ||||||
| } | ||||||
|
|
||||||
| #[test] | ||||||
| #[ignore] // Take too long time | ||||||
| #[test]// Take too long time | ||||||
|
||||||
| #[test]// Take too long time | |
| #[test] // Take too long time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test logic appears incorrect. After ejecting an item from the cache, the assertion expects the item to be
None, but the comment states 'a should be ejected' suggesting it should be present. This contradicts the expected behavior.