This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::fmt;
|
||||
|
||||
pub const DEFAULT_MAINCLOUD_HEALTHZ_URL: &str = "http://127.0.0.1:3100/healthz";
|
||||
pub const DEFAULT_API_SERVER_HEALTHZ_URL: &str = "http://127.0.0.1:3100/healthz";
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct SmokeAssertionError {
|
||||
@@ -32,7 +32,7 @@ impl std::error::Error for SmokeAssertionError {}
|
||||
pub fn normalize_smoke_url(input: impl AsRef<str>) -> String {
|
||||
let trimmed = input.as_ref().trim();
|
||||
if trimmed.is_empty() {
|
||||
return DEFAULT_MAINCLOUD_HEALTHZ_URL.to_string();
|
||||
return DEFAULT_API_SERVER_HEALTHZ_URL.to_string();
|
||||
}
|
||||
|
||||
trimmed.trim_end_matches('/').to_string()
|
||||
@@ -63,10 +63,10 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn normalize_smoke_url_uses_maincloud_healthz_when_empty() {
|
||||
fn normalize_smoke_url_uses_api_server_healthz_when_empty() {
|
||||
assert_eq!(
|
||||
normalize_smoke_url(" "),
|
||||
DEFAULT_MAINCLOUD_HEALTHZ_URL.to_string()
|
||||
DEFAULT_API_SERVER_HEALTHZ_URL.to_string()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user