2018-09-17 15:42:26 +02:00
|
|
|
extern crate benchmark_repository;
|
|
|
|
extern crate pretty_env_logger;
|
2018-09-26 01:17:50 +02:00
|
|
|
extern crate yaml_rust;
|
2018-09-17 15:42:26 +02:00
|
|
|
|
2018-09-17 17:45:30 +02:00
|
|
|
use benchmark_repository::{BenchmarkRepository, TargetPath};
|
2018-09-17 15:42:26 +02:00
|
|
|
|
2018-09-26 01:17:50 +02:00
|
|
|
use std::io::{self, copy, Read};
|
2018-09-17 15:42:26 +02:00
|
|
|
use std::path::Path;
|
2018-09-26 01:17:50 +02:00
|
|
|
use yaml_rust::{YamlLoader, YamlEmitter};
|
2018-09-17 15:42:26 +02:00
|
|
|
|
|
|
|
fn main()
|
|
|
|
{
|
|
|
|
pretty_env_logger::init();
|
|
|
|
|
|
|
|
let benchmark_repository = BenchmarkRepository::new("git@git.luehne.de:patrick/tplp-planning-benchmark.git", Path::new("storage"), "git", "Potassco Bot", "bot@potassco.org");
|
2018-09-17 17:45:30 +02:00
|
|
|
|
2018-09-17 23:45:40 +02:00
|
|
|
/*let files = vec!
|
2018-09-17 17:45:30 +02:00
|
|
|
[
|
|
|
|
TargetPath{source: &Path::new("/tmp/test"), destination: &Path::new("foobar/test")},
|
|
|
|
TargetPath{source: &Path::new("/tmp/test2"), destination: &Path::new("foobar/test-2")},
|
|
|
|
];
|
|
|
|
|
2018-09-17 23:45:40 +02:00
|
|
|
benchmark_repository.commit_files(&files[..], "test-results");*/
|
|
|
|
|
2018-09-26 01:17:50 +02:00
|
|
|
let content = benchmark_repository.read_file(Path::new("configurations.yml"), "test-config").unwrap();
|
|
|
|
let configurations = &YamlLoader::load_from_str(&content).unwrap()[0]["configurations"];
|
|
|
|
|
|
|
|
let content = benchmark_repository.read_file(Path::new("instances.yml"), "test-config").unwrap();
|
|
|
|
let instances = &YamlLoader::load_from_str(&content).unwrap()[0];
|
|
|
|
|
|
|
|
for configuration in configurations.as_vec().unwrap()
|
|
|
|
{
|
|
|
|
for (instance_set_id, instance_set) in instances.as_hash().unwrap()
|
|
|
|
{
|
|
|
|
for instance in instance_set.as_vec().unwrap()
|
|
|
|
{
|
|
|
|
let configuration_id = configuration["id"].as_str().unwrap();
|
|
|
|
let instance_set_id = instance_set_id.as_str().unwrap();
|
|
|
|
let instance_ipc = instance["ipc"].as_str().unwrap();
|
|
|
|
let instance_domain = instance["domain"].as_str().unwrap();
|
|
|
|
let instance_number = instance["instance"].as_i64().unwrap();
|
|
|
|
|
2018-09-26 20:33:53 +02:00
|
|
|
let file_name = format!("{}/{}/{}", instance_ipc, instance_domain, instance_number);
|
|
|
|
|
|
|
|
if (benchmark_repository.file_exists(Path::new(&file_name), "test-results"))
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
println!("to do: [{}, {}, {}/{}/{}]", configuration_id, instance_set_id, instance_ipc, instance_domain, instance_number);
|
2018-09-26 01:17:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-09-17 15:42:26 +02:00
|
|
|
}
|