Skip to content

Commit

Permalink
remove todos
Browse files Browse the repository at this point in the history
  • Loading branch information
laanak08 committed Feb 20, 2025
1 parent 09efa7d commit 0d77f76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
4 changes: 1 addition & 3 deletions crates/goose-bench/src/work_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ impl WorkDir {

impl Drop for WorkDir {
fn drop(&mut self) {
if let Some(parent_path) = self.path.parent() {
std::env::set_current_dir(parent_path).unwrap();
};
std::env::set_current_dir("..").unwrap();
}
}
20 changes: 5 additions & 15 deletions crates/goose-cli/src/commands/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ impl BenchAgent for Session {
Ok(self.message_history())
}
}
fn cwd_todo_remove() {
match std::env::current_dir() {
Ok(path) => println!("Current directory is: {:?}", path),
Err(e) => eprintln!("Failed to get current directory: {}", e)
}
}

pub async fn run_benchmark(suites: Vec<String>) {
let suites = EvaluationSuiteFactory::available_evaluations()
.into_iter()
Expand All @@ -32,23 +27,18 @@ pub async fn run_benchmark(suites: Vec<String>) {
.expect("No provider configured. Run 'goose configure' first");


let _ = cwd_todo_remove();
let current_time = Local::now().format("%H:%M:%S").to_string();
let current_date = Local::now().format("%Y-%m-%d").to_string();
if let _ = WorkDir::work_from(format!("./benchmark-{}", &provider_name)) {
let _ = cwd_todo_remove();
if let Ok(_) = WorkDir::work_from(format!("./benchmark-{}", &provider_name)) {
for suite in suites {
if let _ = WorkDir::work_from(format!("./{}", &suite)) {
let _ = cwd_todo_remove();
if let Ok(_) = WorkDir::work_from(format!("./{}", &suite)) {
let evaluations = match EvaluationSuiteFactory::create(suite) {
Some(evaluations) => evaluations,
None => continue,
};
if let _ = WorkDir::work_from(format!("./{}-{}", &current_date, current_time)) {
let _ = cwd_todo_remove();
if let Ok(_) = WorkDir::work_from(format!("./{}-{}", &current_date, current_time)) {
for evaluation in evaluations {
if let _ = WorkDir::work_from(format!("./{}", &evaluation.name())) {
let _ = cwd_todo_remove();
if let Ok(_) = WorkDir::work_from(format!("./{}", &evaluation.name())) {
let session = build_session(None, false, Vec::new(), Vec::new()).await;
let _ = match evaluation.run(Box::new(session)).await {
Ok(report) => report,
Expand Down

0 comments on commit 0d77f76

Please sign in to comment.