Skip to content

Commit dadb8fb

Browse files
committed
[CI debug] Add more logs to yaml tests downloads
1 parent f4ee5ee commit dadb8fb

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

yaml_test_runner/src/github.rs

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ pub fn download_test_suites(branch: &str, download_dir: &PathBuf) -> Result<(),
3636
if version == branch {
3737
info!("Already downloaded yaml tests from {}", branch);
3838
return Ok(());
39+
} else {
40+
info!(
41+
"Existing yaml tests are from {}, we need {}",
42+
version, branch
43+
);
3944
}
45+
} else {
46+
info!("No existing yaml tests download");
4047
}
4148

4249
info!("Downloading yaml tests from {}", branch);
@@ -63,7 +70,9 @@ pub fn download_test_suites(branch: &str, download_dir: &PathBuf) -> Result<(),
6370
let xpack_test = Glob::new("**/x-pack/plugin/src/test/resources/rest-api-spec/test/**/*.yml")?
6471
.compile_matcher();
6572

73+
let mut test_count = 0;
6674
for entry in archive.entries()? {
75+
test_count += 1;
6776
let file = entry?;
6877
let path = file.path()?;
6978
if oss_test.is_match(&path) {
@@ -73,9 +82,23 @@ pub fn download_test_suites(branch: &str, download_dir: &PathBuf) -> Result<(),
7382
}
7483
}
7584

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+
))
79102
.write_all(branch.as_bytes())
80103
.expect("unable to write branch to last_downloaded_version file");
81104

0 commit comments

Comments
 (0)