@@ -36,7 +36,14 @@ pub fn download_test_suites(branch: &str, download_dir: &PathBuf) -> Result<(),
36
36
if version == branch {
37
37
info ! ( "Already downloaded yaml tests from {}" , branch) ;
38
38
return Ok ( ( ) ) ;
39
+ } else {
40
+ info ! (
41
+ "Existing yaml tests are from {}, we need {}" ,
42
+ version, branch
43
+ ) ;
39
44
}
45
+ } else {
46
+ info ! ( "No existing yaml tests download" ) ;
40
47
}
41
48
42
49
info ! ( "Downloading yaml tests from {}" , branch) ;
@@ -63,7 +70,9 @@ pub fn download_test_suites(branch: &str, download_dir: &PathBuf) -> Result<(),
63
70
let xpack_test = Glob :: new ( "**/x-pack/plugin/src/test/resources/rest-api-spec/test/**/*.yml" ) ?
64
71
. compile_matcher ( ) ;
65
72
73
+ let mut test_count = 0 ;
66
74
for entry in archive. entries ( ) ? {
75
+ test_count += 1 ;
67
76
let file = entry?;
68
77
let path = file. path ( ) ?;
69
78
if oss_test. is_match ( & path) {
@@ -73,9 +82,23 @@ pub fn download_test_suites(branch: &str, download_dir: &PathBuf) -> Result<(),
73
82
}
74
83
}
75
84
76
- info ! ( "Downloaded yaml tests from {}" , & branch) ;
77
- File :: create ( last_downloaded_version)
78
- . expect ( "failed to create last_downloaded_version file" )
85
+ info ! (
86
+ "Downloaded {} yaml tests from {} to {:?}" ,
87
+ test_count, & branch, download_dir
88
+ ) ;
89
+
90
+
91
+ let parent = last_downloaded_version. parent ( ) . unwrap ( ) ;
92
+ fs:: create_dir_all ( parent)
93
+ . expect ( & format ! ( "Failed do create parent directory" ) ) ;
94
+
95
+ info ! ( "{:?} metadata: {:?}" , parent, fs:: metadata( parent) . unwrap( ) ) ;
96
+
97
+ File :: create ( & last_downloaded_version)
98
+ . expect ( & format ! (
99
+ "Failed to create last_downloaded_version file at '{:?}'" ,
100
+ & last_downloaded_version
101
+ ) )
79
102
. write_all ( branch. as_bytes ( ) )
80
103
. expect ( "unable to write branch to last_downloaded_version file" ) ;
81
104
0 commit comments