Add a few more testing features (#36778)
Release Notes: - N/A --------- Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
parent
e6267c42f7
commit
91b2a84001
2 changed files with 10 additions and 4 deletions
2
Procfile.web
Normal file
2
Procfile.web
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
postgrest_llm: postgrest crates/collab/postgrest_llm.conf
|
||||||
|
website: cd ../zed.dev; npm run dev -- --port=3000
|
|
@ -66,6 +66,8 @@ pub static IMPERSONATE_LOGIN: LazyLock<Option<String>> = LazyLock::new(|| {
|
||||||
.and_then(|s| if s.is_empty() { None } else { Some(s) })
|
.and_then(|s| if s.is_empty() { None } else { Some(s) })
|
||||||
});
|
});
|
||||||
|
|
||||||
|
pub static USE_WEB_LOGIN: LazyLock<bool> = LazyLock::new(|| std::env::var("ZED_WEB_LOGIN").is_ok());
|
||||||
|
|
||||||
pub static ADMIN_API_TOKEN: LazyLock<Option<String>> = LazyLock::new(|| {
|
pub static ADMIN_API_TOKEN: LazyLock<Option<String>> = LazyLock::new(|| {
|
||||||
std::env::var("ZED_ADMIN_API_TOKEN")
|
std::env::var("ZED_ADMIN_API_TOKEN")
|
||||||
.ok()
|
.ok()
|
||||||
|
@ -1392,11 +1394,13 @@ impl Client {
|
||||||
if let Some((login, token)) =
|
if let Some((login, token)) =
|
||||||
IMPERSONATE_LOGIN.as_ref().zip(ADMIN_API_TOKEN.as_ref())
|
IMPERSONATE_LOGIN.as_ref().zip(ADMIN_API_TOKEN.as_ref())
|
||||||
{
|
{
|
||||||
eprintln!("authenticate as admin {login}, {token}");
|
if !*USE_WEB_LOGIN {
|
||||||
|
eprintln!("authenticate as admin {login}, {token}");
|
||||||
|
|
||||||
return this
|
return this
|
||||||
.authenticate_as_admin(http, login.clone(), token.clone())
|
.authenticate_as_admin(http, login.clone(), token.clone())
|
||||||
.await;
|
.await;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start an HTTP server to receive the redirect from Zed's sign-in page.
|
// Start an HTTP server to receive the redirect from Zed's sign-in page.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue