Browse Source

Another fix for the historical results generation (#899)

pull/902/head
Iban Eguia 4 years ago committed by GitHub
parent
commit
fbb1077e87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      boa_tester/src/results.rs

25
boa_tester/src/results.rs

@ -70,9 +70,6 @@ pub(crate) fn write_json(
branch = "pull".to_owned(); branch = "pull".to_owned();
} }
// We make sure we are using the latest commit information in GitHub pages:
update_gh_pages_repo(path);
let path = if branch.is_empty() { let path = if branch.is_empty() {
path.to_path_buf() path.to_path_buf()
} else { } else {
@ -81,6 +78,9 @@ pub(crate) fn write_json(
folder folder
}; };
// We make sure we are using the latest commit information in GitHub pages:
update_gh_pages_repo(path.as_path(), verbose);
if verbose != 0 { if verbose != 0 {
println!("Writing the results to {}...", path.display()); println!("Writing the results to {}...", path.display());
} }
@ -140,7 +140,7 @@ fn get_test262_commit() -> Box<str> {
} }
/// Updates the GitHub pages repository by pulling latest changes before writing the new things. /// Updates the GitHub pages repository by pulling latest changes before writing the new things.
fn update_gh_pages_repo(path: &Path) { fn update_gh_pages_repo(path: &Path, verbose: u8) {
if env::var("GITHUB_REF").is_ok() { if env::var("GITHUB_REF").is_ok() {
use std::process::Command; use std::process::Command;
@ -151,11 +151,18 @@ fn update_gh_pages_repo(path: &Path) {
.expect("could not update GitHub Pages"); .expect("could not update GitHub Pages");
// Copy the full results file // Copy the full results file
fs::copy( let from = Path::new("../gh-pages/test262/refs/heads/master/").join(RESULTS_FILE_NAME);
Path::new("../gh-pages/test262/refs/heads/master/").join(RESULTS_FILE_NAME), let to = path.join(RESULTS_FILE_NAME);
path.join(RESULTS_FILE_NAME),
) if verbose != 0 {
.expect("could not copy the master results file"); println!(
"Copying the {} file to {} in order to add the results",
from.display(),
to.display()
);
}
fs::copy(from, to).expect("could not copy the master results file");
} }
} }

Loading…
Cancel
Save