swarm-controller: fix test helper's forge::Client initializer

The stub-client helper in forge.rs built Client { api } after #4703
added a url field, breaking compilation of swarm-controller's test
target on main. Clone the URL the helper already builds for
Forgejo::new so it can also populate Client.url.

Closes #4709
This commit is contained in:
atlas 2026-09-24 20:29:42 +02:00
commit 21c17772b8

View file

@ -1492,8 +1492,8 @@ mod tests {
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();
let url = url::Url::parse(&format!("http://{}/", listener.local_addr().unwrap())).unwrap();
tokio::spawn(async move { axum::serve(listener, app).await });
let api = Forgejo::new(Auth::Token("stub-token"), url).unwrap();
(Client { api }, seen)
let api = Forgejo::new(Auth::Token("stub-token"), url.clone()).unwrap();
(Client { api, url }, seen)
}
/// The `PATCH` [`Client::ensure_agent_user`] sent, if any.