File tree Expand file tree Collapse file tree 3 files changed +23
-15
lines changed Expand file tree Collapse file tree 3 files changed +23
-15
lines changed Original file line number Diff line number Diff line change @@ -28,4 +28,3 @@ git-testtools = "0.8.0"
28
28
# git-repository = "0.22.1"
29
29
git-repository = { version = " 0.22.1" , git = " https://github.com/Byron/gitoxide" , branch = " for-crates-index-diff" }
30
30
tempdir = " 0.3.5"
31
- serial_test = " 0.6.0"
Original file line number Diff line number Diff line change 1
1
use crates_index_diff:: Index ;
2
+ use git_testtools:: tempfile:: TempDir ;
3
+ use std:: path:: PathBuf ;
2
4
3
5
mod changes_from_objects;
4
6
@@ -32,14 +34,31 @@ fn peek_changes() {
32
34
) ;
33
35
}
34
36
35
- mod old;
37
+ #[ test]
38
+ fn clone_if_needed ( ) {
39
+ let tmp = TempDir :: new ( ) . unwrap ( ) ;
40
+ let options = || crates_index_diff:: index:: CloneOptions {
41
+ repository_url : fixture_dir ( ) . unwrap ( ) . join ( "base" ) . display ( ) . to_string ( ) ,
42
+ fetch_options : None ,
43
+ } ;
44
+ Index :: from_path_or_cloned_with_options ( tmp. path ( ) , options ( ) )
45
+ . expect ( "successful clone to be created" ) ;
46
+ Index :: from_path_or_cloned_with_options ( tmp. path ( ) , options ( ) )
47
+ . expect ( "second instance re-uses existing clone" ) ;
48
+ }
36
49
37
50
fn index_ro ( ) -> crate :: Result < Index > {
38
- let dir = git_testtools:: scripted_fixture_repo_read_only_with_args (
51
+ let dir = fixture_dir ( ) ?;
52
+ Ok ( Index :: from_path_or_cloned ( dir. join ( "clone" ) ) ?)
53
+ }
54
+
55
+ fn fixture_dir ( ) -> crate :: Result < PathBuf > {
56
+ Ok ( git_testtools:: scripted_fixture_repo_read_only_with_args (
39
57
"make-index-from-parts.sh" ,
40
58
std:: env:: current_dir ( )
41
59
. ok ( )
42
60
. map ( |p| p. to_str ( ) . unwrap ( ) . to_owned ( ) ) ,
43
- ) ?;
44
- Ok ( Index :: from_path_or_cloned ( dir. join ( "clone" ) ) ?)
61
+ ) ?)
45
62
}
63
+
64
+ mod old;
Original file line number Diff line number Diff line change 1
1
use crates_index_diff:: * ;
2
2
use git2:: Reference ;
3
- use serial_test:: serial;
4
3
use std:: { env, path:: PathBuf } ;
5
4
use tempdir:: TempDir ;
6
5
7
6
const NUM_VERSIONS_AT_RECENT_COMMIT : usize = 39752 ;
8
7
const REV_ONE_UNYANKED : & str = "f8cb00181" ;
9
8
10
- #[ test]
11
- #[ ignore] // This test takes too long for my taste, this library is stable by now
12
- fn clone_if_needed ( ) {
13
- let tmp = TempDir :: new ( "new-index" ) . unwrap ( ) ;
14
- Index :: from_path_or_cloned ( tmp. path ( ) ) . expect ( "successful clone to be created" ) ;
15
- Index :: from_path_or_cloned ( tmp. path ( ) ) . expect ( "second instance re-uses existing clone" ) ;
16
- }
17
-
18
9
fn make_index ( ) -> ( Index , TempDir ) {
19
10
let tmp = TempDir :: new ( "new-index" ) . unwrap ( ) ;
20
11
let index = Index :: from_path_or_cloned (
@@ -34,7 +25,6 @@ fn origin_master_of(index: &Index) -> Reference<'_> {
34
25
}
35
26
36
27
#[ test]
37
- #[ serial]
38
28
#[ ignore]
39
29
fn quick_changes_since_last_fetch ( ) {
40
30
let ( mut index, _tmp) = make_index ( ) ;
You can’t perform that action at this time.
0 commit comments