refactor(maestro): finish moving the e2e harness off raw reqwest
Restores the harness's deliberate 5s per-request budget, which the shared client's 30s default had silently replaced, and converts the last two hand-rolled daemon calls in e2e.rs (recent-dirs, gitroot). Drops reqwest from maestro-e2e entirely. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit was merged in pull request #40.
This commit is contained in:
co-authored by
Claude Opus 5
parent
148f97fa71
commit
ef3d314296
@@ -230,7 +230,6 @@ async fn spawn_records_history_and_infers_gitroot_for_form() {
|
||||
// (#27's recents picker), and gitroot infers the worktree base_repo from the
|
||||
// same dir. Exercised end to end against real tmux + git.
|
||||
let (daemon, client) = bring_up().await;
|
||||
let daemon_base = daemon.http_base();
|
||||
|
||||
// A git repo as the working dir, so gitroot has a repo to infer.
|
||||
let repo = TempDir::new().unwrap();
|
||||
@@ -250,16 +249,11 @@ async fn spawn_records_history_and_infers_gitroot_for_form() {
|
||||
"recent-dirs surfaces the spawned cwd",
|
||||
Duration::from_secs(5),
|
||||
|| {
|
||||
let url = format!("{daemon_base}/api/recent-dirs");
|
||||
let client = daemon.client();
|
||||
let want = cwd.clone();
|
||||
async move {
|
||||
let resp = match reqwest::get(&url).await {
|
||||
Ok(r) => r,
|
||||
Err(_) => return false,
|
||||
};
|
||||
let recents: maestro_protocol::RecentDirs = match resp.json().await {
|
||||
Ok(v) => v,
|
||||
Err(_) => return false,
|
||||
let Ok(recents) = client.recent_dirs().await else {
|
||||
return false;
|
||||
};
|
||||
recents
|
||||
.dirs
|
||||
@@ -272,15 +266,7 @@ async fn spawn_records_history_and_infers_gitroot_for_form() {
|
||||
|
||||
// gitroot infers the worktree base_repo from the same dir (#25/#26): the dir
|
||||
// is itself the repo toplevel (it holds `.git`).
|
||||
let gr: maestro_protocol::GitRoot = reqwest::Client::new()
|
||||
.get(format!("{daemon_base}/api/gitroot"))
|
||||
.query(&[("path", cwd.as_str())])
|
||||
.send()
|
||||
.await
|
||||
.expect("gitroot request")
|
||||
.json()
|
||||
.await
|
||||
.expect("gitroot json");
|
||||
let gr = daemon.client().git_root(&cwd).await.expect("gitroot");
|
||||
assert_eq!(
|
||||
gr.root.as_deref().map(|p| p.to_string_lossy().to_string()),
|
||||
Some(cwd.clone()),
|
||||
|
||||
Reference in New Issue
Block a user