[core] Phase 1: core, edge and differential tests #2
@@ -182,13 +182,13 @@ enum Guard {
|
|||||||
|
|
||||||
impl Drop for Target {
|
impl Drop for Target {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if let Guard::Edge(stop) = &mut self._guard {
|
if let Guard::Edge(stop) = &mut self._guard
|
||||||
if let Some(s) = stop.take() {
|
&& let Some(s) = stop.take()
|
||||||
|
{
|
||||||
let _ = s.send(());
|
let _ = s.send(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// Start Ianitor edge in this process from an edge config text.
|
/// Start Ianitor edge in this process from an edge config text.
|
||||||
pub fn start_edge(env: &Env, name: &'static str, config_text: &str) -> Target {
|
pub fn start_edge(env: &Env, name: &'static str, config_text: &str) -> Target {
|
||||||
@@ -693,11 +693,11 @@ pub fn break_caddy(json: &str) -> String {
|
|||||||
fn walk(v: &mut serde_json::Value) {
|
fn walk(v: &mut serde_json::Value) {
|
||||||
match v {
|
match v {
|
||||||
serde_json::Value::Object(m) => {
|
serde_json::Value::Object(m) => {
|
||||||
if m.get("handler").and_then(|h| h.as_str()) == Some("reverse_proxy") {
|
if m.get("handler").and_then(|h| h.as_str()) == Some("reverse_proxy")
|
||||||
if let Some(h) = m.get_mut("headers").and_then(|h| h.as_object_mut()) {
|
&& let Some(h) = m.get_mut("headers").and_then(|h| h.as_object_mut())
|
||||||
|
{
|
||||||
h.remove("response");
|
h.remove("response");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
m.values_mut().for_each(walk);
|
m.values_mut().for_each(walk);
|
||||||
}
|
}
|
||||||
serde_json::Value::Array(a) => a.iter_mut().for_each(walk),
|
serde_json::Value::Array(a) => a.iter_mut().for_each(walk),
|
||||||
|
|||||||
@@ -97,7 +97,10 @@ pub fn require_binary(name: &str) -> Option<PathBuf> {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
let var = format!("IANITOR_{}_BIN", name.to_ascii_uppercase().replace('-', "_"));
|
let var = format!(
|
||||||
|
"IANITOR_{}_BIN",
|
||||||
|
name.to_ascii_uppercase().replace('-', "_")
|
||||||
|
);
|
||||||
panic!(
|
panic!(
|
||||||
"`{name}` is needed for this test but was not found on PATH (or ${var}). \
|
"`{name}` is needed for this test but was not found on PATH (or ${var}). \
|
||||||
In WSL: nix profile add nixpkgs#{name}. Set IANITOR_ALLOW_SKIP=1 to skip instead."
|
In WSL: nix profile add nixpkgs#{name}. Set IANITOR_ALLOW_SKIP=1 to skip instead."
|
||||||
|
|||||||
Reference in New Issue
Block a user